Change Admin menu placement using hooks

I’ve fixed it… Posting the solution here if it helps someone… Here is the final code that fixed my problem : /** Remove the Menu registered by Plugin **/ add_action( ‘admin_menu’, ‘my_remove_tp’, 999 ); function my_remove_tp() { remove_submenu_page( ‘themes.php’, ‘upprev/admin/index.php’ ); } /** Re-Register the menu from here **/ add_action(‘admin_menu’, ‘upprev_menu2’); function upprev_menu2(){ add_options_page(‘upPrev Menu’, … Read more

Plugin admin list pages as submenu

You do not post how you add the top level menu page, however I think when you click on a submenu item you have an url like: http://www.example.com/wp-admin/admin.php?page=theme_admin_{$pageid} So the id of page is in the $_GET[‘page’] variable with a fixed string prepended to it. So why don’t use something like: function display_page_test() { $id … Read more

Add a link to the Admin menu

You can intercept the global $submenu var and add the desired elements: add_action(‘admin_menu’, ‘add_custom_submenus’, 999); function add_custom_submenus() { global $submenu; $submenu[‘edit.php’][] = array( __(‘Published’), // menu title ‘edit_posts’, // menu cap ‘edit.php?post_status=publish&post_type=post’ // menu link ); $submenu[‘edit.php’][] = array( __(‘Scheduled’), ‘edit_posts’, ‘edit.php?post_status=future&post_type=post’ ); $submenu[‘upload.php’][] = array( __(‘Unattached’), ‘upload_files’, ‘upload.php?detached=1’ ); }

Custom admin menu for a selection of pages

Approach 1: You could assign the role of “editor” to the user, assign the user as author of the three pages and thereafter limit the user to editing only those three pages by following this outlined methodology: http://www.godaisies.com/2010/08/23/how-to-make-editors-only-able-to-edit-their-own-page-in-wordpress/ This however does not fulfill your requirement of a dedicated custom admin page. It simply limits what … Read more

Add internal page to admin menu

Yes, it’s possible. First of all you need a way to identify the page. there are different way to do it: by page slug, by page template… I suggest you to create a fucntion that retrieve that page. Let’s assume the contact page has a page template called ‘page-contacts.php’. function get_contact_page() { $args = array( … Read more

How can I modify text in admin bar?

Are you referring to the meta bar where people can login or register? I’d recommend using jQuery, because if you make the change to the core, it’ll be overwritten once you update it. $(‘a[href*=”register”]’).text(‘join’); This basically states find an anchor tag where the href contains the word register. Once it finds it, it changes the … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)