How to restrict the editors from viewing/editing pages created by admin?

This code will do the job… <?php add_action(‘pre_get_posts’, ‘filter_posts_list’); function filter_posts_list($query) { //$pagenow holds the name of the current page being viewed, we want to run our code only on edit.php (posts list) global $pagenow; //If the ‘Editor’ is logged in, exclude ‘Admin’s posts if(current_user_can(‘editor’) && (‘edit.php’ == $pagenow)) { //global $query’s set() method for … Read more

Get admin menu link

You can use admin_url(‘nav-menus.php’); This function can be used to get url’s for any admin screen, please check out the codex for more information http://codex.wordpress.org/Function_Reference/admin_url

Image popup in a lightbox / overlay from the backend 3.5 admin area (plugin)

You can just use the built in ThickBox. Maybe not the pretties library but it does its job. Just add the class thickbox to the link and add the image to the href Here is a simple example: <?php echo ‘<a href=”https://wordpress.stackexchange.com/questions/78749/image.png” class=”thickbox”>’. __(‘Test image’, ‘domain’) .'</a>’; ?> Read more about ThickBox here.

Custom order categories in admin dashboard

Use the get_terms_args hook and modify the orderby argument, like so: add_filter( ‘get_terms_args’, ‘my_sort_terms’, 10, 2 ); function my_sort_terms( $args, $taxonomies ) { $args[‘orderby’] = ‘description’; return $args; } Possible values for this argument are listed in the codex.

Set admin body to ltr on a rtl installation

Important: You shouldn’t modify core files, because you might loose all your edits in the next core upgrade. You should instead enqueue your own stylesheet with your custom CSS modifications through the admin_enqueue_scripts hook or use a hook like admin_head to implement your customization. Here’s an example: /** * Force #wpbody to the ‘ltr’ direction: … Read more