Display an image of selected template in admin to aid user when using complex templates

Preliminary Tasks Create a directory within your theme to contain your layout thumbs. Add layout thumbs to reflect the file names of your template. The following script uses the format tpl-homepage.php. The image would be named homepage.jpg. Please note, the following is a proof-of-concept. Approach 1: Only JavaScript Load the following only for post.php and … Read more

Add JavaScript in admin in custom plugin [duplicate]

Admin area has its own hooks in header and footer, respectively: do_action(‘admin_enqueue_scripts’, $hook_suffix); do_action(“admin_print_styles-$hook_suffix”); do_action(‘admin_print_styles’); do_action(“admin_print_scripts-$hook_suffix”); do_action(‘admin_print_scripts’); do_action(“admin_head-$hook_suffix”); do_action(‘admin_head’); and do_action(‘admin_footer’, ”); do_action(‘admin_print_footer_scripts’); do_action(“admin_footer-” . $GLOBALS[‘hook_suffix’]);

Visual Editor only working for the admin user

http://wordpress.org/support/topic/upgraded-to-32-visual-editor-buttons-missing/page/2 this fixed it. The Tiny MCE is looking for a file: wp-includes/js/tinymce/langs/en.js I just checked the file and on my installation the file path is this: wp-includes/js/tinymce/langs/wp-langs-en.js I deleted the ‘wp-langs-‘ part of the file name ‘wp-langs-en.js’ and I seem to be working again.

Posts in sidebar only by admin

You need to add an author parameter to the query that is creating $cust_loop. You didn’t post that part of your code but something like: $cust_loop = new WP_Query( ‘author=123’ ); Or: $cust_loop = new WP_Query( ‘author_name=rami’ ); Note: Both of those taken (almost) straight from the Codex paged for WP_Query.

How to show a custom notification to a specific user?

You can show admin notices via the admin_notices action. You can display it for a specific user by checking the contents of the global $current_user: function wpa80367_admin_notice() { global $current_user; if ( ‘someusername’ == $current_user->user_login ): echo ‘<div class=”updated”><p>’; echo ‘This is an admin notice just for you, someusername.’; echo ‘</p></div>’; endif; } add_action( ‘admin_notices’, … Read more

“sufficient permissions” error for admin after duplicating WP database to new install

So you’ve duplicated the tables in the DB, with the new set having the dev_ prefix? In that case, the problem is probably that you have not updated the fields within the duplicated tables that inherit that prefix. For instance, dev_usermeta will now have a meta_key called wp_capabilities. This needs to be dev_capabilities. Also, dev_options … Read more

How do I create a post_id column, for admin posts list?

You haven’t set $post_id so there is no reason is should display. If you have debugging enabled as you should when you are working, you would have spotted the error immediately. What you need to do is: add_action( ‘manage_posts_custom_column’, ‘populate_columns’ ); function populate_columns( $column ) { global $post; if ($column == ‘id’){ echo $post->ID; } … Read more

Admin user roles/permissions

The “Contributor” role has very little access to anything on the back end but can created posts. delete_posts edit_posts read http://codex.wordpress.org/Roles_and_Capabilities#Contributor For comparison, an ordinary “Subscriber” has the last of the three, so “Contributor” has only two extra capabilities. I am not quite sure what “access to specific plugins” means exactly but I am nearly … Read more