How can I load an inline script after the enqueued scripts in admin?
I finally found the answer. I need to use the admin_print_footer_scripts action. This will add scripts after the scripts that were called with wp_enqueue_scripts.
I finally found the answer. I need to use the admin_print_footer_scripts action. This will add scripts after the scripts that were called with wp_enqueue_scripts.
The admin toolbar is displayed for all users, including Subscribers. If it’s not appearing on your site, then you are likely be using a plugin that changes this behaviour. For example, WooCommerce hides the admin bar from users who do not have the edit_posts or manage_woocommerce, capability. They have a support article on disabling this … Read more
I assume you mean /wp-admin/profile.php page and want to hide native password fields. Try this (just test if form works ok with it): add_filter( ‘show_password_fields’, ‘modify_profile_password’ ); function modify_profile_password( $show ) { ?> <tr id=”password”> <th>Change your password at</th> <td><a href=””>password change page</a></td> </tr> <?php return false; }
I don’t see easy way to change default so far, fresh color scheme seems to be hardcoded in plenty of places. If you just need to force some specific scheme for all users it can be done with this: add_filter(‘get_user_option_admin_color’,’change_admin_color’); function change_admin_color($result) { return ‘classic’; }
I figured out how: <?php // Theme Options require_once(TEMPLATEPATH . ‘/functions/admin-menu.php’); add_action( ‘wp_head’, ‘theme_options’); function theme_options() { // Initiate Theme Options $options = get_option(‘plugin_options’); // If logo image was uploaded then remove text from site title if ($options[‘logo’] != NULL) $remove_text=”-9999px”; else $remove_text = 0; ?><style> body { background-color: <?php echo $options[‘color_scheme’]; ?> } #header … Read more
The transient is in place just fine, see get_dir_size() source. Note that if you have enough files for this to cause major performance issues you are probably better disabling upload limit or it might mess up other related functionality like uploads.
You can use current_user_can() to determine if an admin user is logged and load your Google tracking code using wp_enqueue_script with an if statement in functions.php if ( ! current_user_can( ‘edit_posts’ ) ) { wp_enqueue_script( ‘google-tracking’); }
There is an action, ‘core_upgrade_preamble’, which can be added to output anything you would like at the bottom of the upgrade-core page. For example, try: add_action(‘core_upgrade_preamble’, ‘add_custom_upgrade_core_message’); function add_custom_upgrade_core_message(){ echo “<p>HI THERE</p>”; } That should work to meet your needs.
You need the information about the current post type in your callback function that renders the submenu page output. And at this point there is a lot of information ready: add_action( ‘admin_menu’, ‘wpse_60730_demo_submenu’ ); /** * Register sub menu pages. * * Note that get_current_screen() is still NULL now. * * @wp-hook admin_menu * @return … Read more
You can use the wordpress function user_can that accepts as arguments the id of the user and a string representing a capability or a role name (‘administrator’ in your case ) and returns a boolean value. http://codex.wordpress.org/Function_Reference/user_can Referred to your code you can try this <?php if( !user_can( get_the_author_meta( ‘ID’ ), ‘administrator’ ) ): ?> … Read more