Tag Info

Hot answers tagged

3

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' ), ...


2

Rather than blacklist logins, why not whitelist your own IP (example 12.345.67.891 below; or a range) for wp-login.php and in wp-admin for logins and administration? (No plugin needed). A whitelist will block everyone else except you from login. See http://httpd.apache.org/docs/2.4/howto/access.html in the .htaccess in the wp-admin folder: Options All ...


1

I'm not 100% sure exactly what you wish to place in the 'last revision' column, but just so you are aware you can switch the view on the Posts table to Excerpt View using the button below the search box. This view allows you to see the first few lines of the post as well as all of the other default information - Please see this page for more information ...


1

You could try this modification of your code: function add_author_edit_link( $wp_admin_bar ) { if ( is_author() && current_user_can( 'add_users' ) ) { $args = array( 'id' => 'author-edit', 'title' => __( 'Edit Author' ), 'href' => admin_url( sprintf( ...


1

According to the documentation for add_menu_page: Note: If you're running into the "You do not have sufficient permissions to access this page" error, then you've hooked too early. The hook you should use is admin_menu. This means you need to wrap your menu creation in something like: add_action( 'admin_menu', function() { add_menu_page( ...


1

What you have does indeed sound more like production and development. General practice it that between these two the data only goes from production to development, but never the other way. Having true staging, you can push the data from to production, is challenging precisely for the reasons you describe. There are solutions around, but even those on ...


1

According with the codex, get_current_screen() has to be used later than admin_init hook. After a few tests, it seems that the safiest way is to use current_screen action hook instead of get_current_screen(): add_action('current_screen', 'current_screen_callback'); function current_screen_callback($screen) { if( is_object($screen) && ...


1

get_current_screen() is a pain, I use the following code to avoid/wrap it: /* * Convenience function to tell if we're on a specified page. */ function theme_is_current_screen( $base = null, $post_type = null ) { if ( ! $base && ! $post_type ) { return false; } $screen = function_exists( 'get_current_screen' ) ? ...



Only top voted, non community-wiki answers of a minimum length are eligible