Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

Diraen on "Add a new admin menu linked to a Private Custom Help System"

$
0
0

Hi !

I've several authors on my blog and want to allow them to find all the writting instructions they need in the same private page.

I don't want to use a plugin.
I've all my private pages.
I've added a custom menu, but it leads to a page where are the links to the private pages.

First, I've created a menu that work but the html code is in the function.php file which is not clean enought for me.

add_action('admin_menu', 'my_menu_pages');
function my_menu_pages(){
						// Add to admin_menu function
add_menu_page(
__('How to'), //The title used on the settings page.
__('How to'), //The title used on the menu.
'manage_options',  //Only displays the menu if the user matches this capability.
'custom_admin_how_to',  // The unique name of the menu slug.
themes.php?goto=build-styleguide-page
'pg_building_function', //This is the callback function to run to display the page.
'', //Display a icon just for the menu
3); //This allows you to choose when the menu item appears in the list

function pg_building_function(){
if(!current_user_can('manage_options')){
//wp_die( __( 'Vous n'avez pas les droits pour accèder à cette plop page.' ) );
}//end if user is allowed.
//add any form processing code here in PHP:
?>
<div style="width:750px;">
<h1><span style="position:relative;top:-7px">How to integrate images</span></h1>

Second , I don't want to open the "How To" summary in the same page : Authors are supposed to click on this menu while they are writting their post. If the page open directly, they will lost they work. I need it to open to a new window or at least in a new tab.


Viewing all articles
Browse latest Browse all 8245

Trending Articles