Hide update messages from non-admin users?
Hide Update reminder – this hides update messages for all non-admin users
Hide Update reminder – this hides update messages for all non-admin users
DOING_AJAX and WP_ADMIN (this constant is checked within is_admin() ) are defined in admin-ajax.php and set tro true. Both are not very helpfull in this situation. Add a parameter to your ajax request if the request come from the front-end: <?php function my_action_javascript() { ?> <script type=”text/javascript” > jQuery(document).ready(function($) { var data = { action: … Read more
You must use add_meta_box function. Take a look to this tutorials: Using add_meta_box() Tutorial: Creating Custom Write Panels in WordPress Example How To Add Meta Boxes To Edit Area
The folder location /wp-admin is hardcoded into wordpress in multiple locations. It is pretty problematic to modify the location. WordPress will always go to /wp-admin. There are ways around this, but their are many steps. You can forward a subdomain to www.mydomain.net/wp-admin but WordPress will still always go through www.mydomain.net/wp-admin. Here is a reference if … Read more
Confirming… Yes, there’s currently (WP 3.4.1) no way to modify the access arguments for admin menu pages. The only one, that you can modify through the public wp API is the »Comments« menu item. All others are registered by hand. But there’s help coming from @scribu (read more at the trac ticket) who has so … Read more
For WP versions before 3.5.0, use the media_buttons_context filter: add_filter( ‘media_buttons_context’, function($context ) { global $pagenow; if ( in_array( $pagenow, array( ‘post.php’, ‘page.php’, ‘post-new.php’, ‘post-edit.php’ ) ) ) { $context .= ‘<a href=”#” class=”button”>Button</a>’; } return $context; } ); For 3.5.0+, use the media_buttons action: add_action( ‘media_buttons’, function($editor_id){ echo ‘<a href=”#” class=”button”>Button</a>’; } ); Both … Read more
I had the same issue as you did, but I found how to fix it in this tutorial: https://digwp.com/2016/05/wordpress-admin-notices/ Basically, I had my settings page outside of the Settings menu, so I had to explicitly add settings_errors() to my options page and they started working. 🙂 Hope that helps.
From the looks of it your adding php right in the css which will not work. You need to write to the css file itself or dump it right into the html as Jeremy said as I am writing this:) Writing a new CSS file every time you make any changes can tax your system, … Read more
For cases where you want to require/include PHP files, but still allow child themes to replace those PHP files outright, then you should use the locate_template function. Example: Parent does this: locate_template( ‘admin/file.php’, true ); This finds the admin/file.php file in either the child or the parent theme, then does a require on it (that’s … Read more
you want to use admin_print_scripts-(page_hook) and admin_print_styles-(page_hook), so in your case: add_action(‘admin_print_scripts-post.php’, ‘call_my_function’); add_action(‘admin_print_scripts-post-new.php’, ‘call_my_function’); add_action(‘admin_print_styles-post.php’, ‘call_my_styles_function’); add_action(‘admin_print_styles-post-new.php’, ‘call_my_styles_function’);