admin_head-post.php only works after publish / update
There isn’t a single hook for both, the new post page is admin_head-post-new.php.
There isn’t a single hook for both, the new post page is admin_head-post-new.php.
add_options_page( $page_title, $menu_title, $capability, $menu_slug, $function); add_options_page( ‘Login’, ‘Login Page’, ‘manage_options’, ‘loop.php?url=”.esc_url($login_url).”‘); You’re trying to feed a URL to an option that takes only a slug. $menu_slug (string) (required) The slug name to refer to this menu by (should be unique for this menu). Default: None from http://codex.wordpress.org/Function_Reference/add_options_page You can easily add a link to … Read more
I am not sure how are you ending up with these results. The earliest hook it should work at is roughly admin_init. Anything as early as load process (wp-settings.php, including function.php, plugins_loaded, and even init) should (and does in my installation) produce fatal error, because function definitions hadn’t loaded yet. The definition for these functions … Read more
You can use User Admin Simplifier plugin. It allows you to hide plugins and options from choosen users.
It’s becouse you’r calling alter_item function outside action admin_menu here’s working example i just made, try to figure what’s wrong with your’s by your self, if you fail i’ll explain add_action( ‘admin_menu’, ‘alter_items’ ); function alter_items() { global $current_user, $menu; get_currentuserinfo(); $scopes = apply_filters( ‘alter_items’, array() ); if( ! empty( $scopes ) ) { foreach( … Read more
Hmm, missed this codex page… To solve this the number should be passed as a decimal as a string rather than an int; 20 -> ‘19.1’ adjusted code; add_menu_page( ‘Settings’, ‘Settings’, ‘manage_options’, ‘plugin_name’, ‘plugin_name_options_page’, content_url( ‘/img/icon.png’, __FILE__), ‘19.1’ );
Unfortunately WordPress does not support third-level admin menu, so there’s no easy way to achieve the result you want. You can only remove these 4 submenu items, add a submenu item instead which will be a link to a custom admin page and display these 4 links within that page (content). Read about following hooks: … Read more
The simplest solution I have for this, is in my themes function, or in a custom plugin file (if you have plugins you are working with) add this code: add_action( ‘admin_head’, ‘kaz_stop_sidescroll’ ); function kaz_stop_sidescroll(){ ?> <style type=”text/css”> #adminmenuwrap {position: relative!important;} </style> <?php } This will only add the styles to the admin area head … Read more
Lots of plugins utilize is_admin to “disable” themselves when the backend is active, which is quite nice. On the other hand I would not really fumble around in the backend. If something goes wrong you might lock yourself out, and if it´s only for a moment, I wouldn´t like that. Furthermore I think you have … Read more
The issue is that pre_get_posts runs on both the Front End and on the Admin Side unless you specifically tell it not to, here’s the function you supplied with a small twist: function pregp_archive_ppp_wpse_108225( $qry ) { if( is_admin() ) { return; } if( $qry->is_main_query() && $qry->is_archive() ) { $qry->set( ‘posts_per_page’, 5 ); $qry->set( ‘post_type’, … Read more