How To Create a Metabox of HTML Content with Instructions For Editors When Editing a Post or Page?

Don’t know any plugin for that. But it can be solved creating a custom plugin with the Settings API and a Custom Meta Box. Adding a RichText Editor in the Settings Page /wp-admin/options-general.php <?php /* Plugin Name: Custom Editor in Settings Page */ add_action( ‘admin_init’, ‘register_settings_wpse_57647’ ); # Register settings function register_settings_wpse_57647() { register_setting( ‘general’, … Read more

Displaying which Role the current user is assigned to

As you suggested, here’s how you can display the roles next to the username in the admin bar: function wpse_203917_admin_bar_menu( $wp_admin_bar ) { if ( ! $node = $wp_admin_bar->get_node( ‘my-account’ ) ) return; $roles = wp_get_current_user()->roles; $node->title .= sprintf( ‘ (%s)’, implode( ‘, ‘, $roles ) ); $wp_admin_bar->add_node( $node ); } add_action( ‘admin_bar_menu’, ‘wpse_203917_admin_bar_menu’ );

URLs of plugin resources?

I am trying to add in a script and css file for my plugin into the admin header. Then like any good developer you should be using wp_enqueue_script or wp_enqueue_style so you’re not hard-coding those script/style includes into the plugin(meaning a user can unhook them if he/she needed to). http://codex.wordpress.org/Function_Reference/wp_enqueue_script http://codex.wordpress.org/Function_Reference/wp_enqueue_style If the styles/scripts are … Read more

How to get the password and username of the add new user form (admin back end) in wordpress

You’ll need three hooks: 1: user_register This is for when the user is created via the admin back-end. The username will be available via $_POST[‘user_login’] and the password will be available via $_POST[‘pass1’]. 2: edit_user_profile_update This is for when the password is updated on the profile page by the user or admin. The username will … Read more

Displaying Post Title on Post Edit page?

This will do it: function edit_screen_title() { global $post, $title, $action, $current_screen; if( isset( $current_screen->post_type ) && $current_screen->post_type == ‘post’ && $action == ‘edit’ ) $title=”Edit ” . $post->post_title; } add_action( ‘admin_head’, ‘edit_screen_title’ );

Only allow new subpages to be created

Code based in Bainternet’s answer to this question: Make Categories and Tags required in admin See code comments. add_action( ‘admin_head-post-new.php’, ‘wpse_59770_publish_admin_hook’ ); add_action( ‘admin_head-post.php’, ‘wpse_59770_publish_admin_hook’ ); add_action( ‘wp_ajax_wpse_59770_pre_submit_validation’, ‘wpse_59770_ajax_pre_submit_validation’ ); function wpse_59770_publish_admin_hook() { global $current_screen; if( ‘page’ != $current_screen->post_type ) return; ?> <script language=”javascript” type=”text/javascript”> jQuery(document).ready(function() { jQuery(‘#publish’).click(function() { var form_data = jQuery(‘#parent_id’).val(); form_data = … Read more