How to Show Different Information to your authors/contributers

We will use the admin_notices hook to display the information on top of the editor. First, a very basic example function educadme_fill_then_save_admin_notice(){ global $pagenow; if ( $pagenow == ‘post.php’ || $pagenow == ‘post-new.php’ ) { echo ‘<div class=”alert”> <p>This is some text. You can embed images, videos, whatever, and they will display on top of … Read more

Get new (not old) post inside transition_post_status hook

According to the Codex, if you use wp_transition_post_status() you will get both the old version and the new version. wp_transition_post_status( $new_status, $old_status, $post ) The ticket also says that the post type needs to support revisions for the save to work. Check the post type of the post objects before doing anything. If your post … Read more

In the Edit Post page how do I modify with jQuery the status select list?

Your first line works for me when I type it in the console of Chrome: jQuery(‘#post_status option[value=”draft”]’).text(‘Approve’); so I assume your problem may be that the element you want might not be loaded yet from where you run your script. Try wrapping it in this: jQuery(document).ready(function() { (function ($) { $(‘#post_status option[value=”draft”]’).text(‘Approve’); })(jQuery); });

How to update post status to draft if user role is “pending’

You should be able to use the set_user_role action which is triggered when a user’s role is changed. The action function is passed the user’s ID, new role, and old role(s). Something like this: add_action( ‘set_user_role’, ‘wpse161590_set_user_role’, 10, 3 ); function wpse161590_set_user_role( $user_id, $role, $old_roles ) { if ( ‘Pending’ == $role ) { // … Read more