How can I allow core, plugin, theme update checks only for selected admins?
I think you should better create a custom role for “administrators-non-administrators” without the update_core, update_plugins and update_themes capabilities.
I think you should better create a custom role for “administrators-non-administrators” without the update_core, update_plugins and update_themes capabilities.
You can do a simple is_admin() check before dequeuing your script like below: Code: add_action( ‘wp_print_scripts’, ‘my_deregister_javascript’, 100 ); function my_deregister_javascript() { if ( !is_admin() ) wp_deregister_script( ‘wp-embed’ ); } }
Upgrade to PHP 5.2 or above The Error Message you see is by WordPress. It’s very misleading what it basically saying is, that you need a PHP version >= 5.2 for that feature to work. Please look into your operating systems documentation or contact technical support on how to update your PHP version. For CentOS, … Read more
Just figured it out… It was the positioning of the define statement. I added the below above the /* That’s all, stop editing! Happy blogging. */ line define(‘FORCE_SSL_ADMIN’, true); define(‘FORCE_SSL_LOGIN’, true); Thanks!
You’ve got your action/filter names slightly off: // For registering the column add_filter( ‘manage_posts_columns’, ‘custom_posts_table_head’ ); // For rendering the column add_action( ‘manage_posts_custom_column’, ‘custom_posts_table_content’, 10, 2 );
In my case, it ended up being some kind of adverse interaction in the nginx wordpress config that I had. Something about not passing along the naked arguments: location / { original line: try_files $uri @php; new line: try_files $uri $uri/ /index.php?$args; } And the associated upstream was wrong. Used the config suggested here: https://www.nginx.com/resources/wiki/start/topics/recipes/wordpress/ … Read more
You can hook into ‘post_submitbox_misc_actions’ or ‘post_submitbox_start’: add_action( ‘post_submitbox_misc_actions’, ‘wpse_45720_submitdiv_extra’ ); add_action( ‘post_submitbox_start’, ‘wpse_45720_submitdiv_extra’ ); function wpse_45720_submitdiv_extra() { print ‘<pre>’ . current_filter() . ‘</pre>’; }
This is how I solved it: In functions.php // Custom Dashboard function my_custom_dashboard() { $screen = get_current_screen(); if( $screen->base == ‘dashboard’ ) { include ‘admin/dashboard-panel.php’; } } add_action(‘admin_notices’, ‘my_custom_dashboard’); dashboard-panel.php <!– Hide Old Wrap with CSS –> <style type=”text/css”> div#wpcontent div.wrap { display: none; } div#wpcontent div.my-dashboard { display: block; } </style> <!– New Wrap … Read more
This meta box is using the function wp_dropdown_users() to list all users. It has only one filter to change the output: wp_dropdown_users. But this filter offers just the complete markup and users. It’s neither easy nor fast to parse this via regex for user names, check their roles and then give back an new HTML. … Read more
You’re supposed to enqueue on the wp_enqueue_scripts event. Placing the function in functions.php and immediately running it, will make it run on all pages, including the admin area Here’s an example from the devhub: /** * Proper way to enqueue scripts and styles. */ function wpdocs_theme_name_scripts() { wp_enqueue_style( ‘style-name’, get_stylesheet_uri() ); wp_enqueue_script( ‘script-name’, get_template_directory_uri() . … Read more