How to access $menu variable in custom .PHP file that loads wp-load.php?
How to access $menu variable in custom .PHP file that loads wp-load.php?
How to access $menu variable in custom .PHP file that loads wp-load.php?
I rewrote the code: /* Plugin Name: Admin Menu Post List Plugin URI: Description: Display a simple post list in admin menu for easy access Version: 0.2 Author: Eliot Akira Author URI: License: GPL2 */ /* * Load CSS in header */ function custom_post_list_view_css() { ?> <style> .post_list_view_headline { padding-left: 10px !important; padding-right: 10px !important; … Read more
Could possibly be this bug http://core.trac.wordpress.org/ticket/14134 and http://wordpress.org/support/topic/rc32-menus-still-crippled?replies=28 but 17 menu items is very low threshold. Try raising your php memory allocation using FTP: 1) You can edit the memory_limit line in your php.ini (if you have access to that file) to 64M: memory_limit = 64M; 2) If you can’t get to the php.ini file, … Read more
You can check out this excellent answer by @Eugene Manuilov. In your case the relevant admin page action is: load-appearance_page_customstyle and the url to the custom stylesheet you want to edit: get_admin_url().’theme-editor.php?file=custom-stylesheet.css&theme=”. get_stylesheet().”&scrollto=0′; Then your code example would be: add_action(‘admin_menu’, ‘add_appearance_menu’); function add_appearance_menu() { add_submenu_page( ‘themes.php’, ‘Custom Stylesheet’, ‘customstyle’, ‘manage_options’, ‘customstyle’, ‘__return_null’); } add_action( ‘load-appearance_page_customstyle’, … Read more
The easiest and most clean way to solve that problem is using a specialised object. First create a class that can hold extra information: class Menu_Page { public $extra=””; public function render() { print $this->extra; } } Now create an object from that class … $page = new Menu_Page; $page->extra=”Hello World!”; … and register its … Read more
You need to “hook” it to an action, in this case admin_menu: add_action( ‘admin_menu’, ‘remove_admin_menus’ ); Just place it right after the function.
Your question is very abstract. It actually vary form plugin to plugin how the organize the menu and pages. So it’s kinda hard to know how the plugin developer has managed the pages in their code. By the way as far I understood, you need to remove the page by using remove_menu_page function. Here is … Read more
Fifth parameter of add_menu_page is of type callable. So you can’t just give it “test.php” and expect it to load. But you could probably do something like: // Include the fine with some function for example bananaMonday() declared include_once( __DIR__ . ‘/test.php’ ); // And then use it as param for add_menu_page add_menu_page(‘Test’, ‘test’, ‘manage_options’, … Read more
Remove ‘admin.php?page=” from those values. “admin.php?page=custom_settings_page’ should be ‘custom_settings_page’ ‘admin.php?page=gf_edit_forms’ should be ‘gf_edit_forms’ Values that start with admin.php only have their parameter set in the global default menu order array (global $default_menu_order). So when the sort occurs between your custom menu order array and the global default menu menu order array, it won’t correctly match … Read more
Solution – add_action( ‘admin_menu’, ‘wpse_admin_menu’, 100 ); function wpse_admin_menu() { global $menu, $submenu; $parent=”gf_edit_forms”; if( !isset($submenu[$parent]) ) return; foreach( $submenu[$parent] as $k => $d ){ if( $d[‘2’] == ‘gf_entries’ ) { $submenu[$parent][$k][‘2’] = ‘admin.php?page=gf_entries&id=2’; break; } } }