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

Changing a post status name

I think the only way is to Change it’s translation. From ‘Trash’ to ‘Archive’. But this can have side-effects. As I searched in the core file (modifying core-files is ALWAYS a BAD idea!!) there where no filter called, wich you coul hook into to Bypass…

Function/filter or plugin to change post status based on custom field value

Paste this onto any page and load the page (or make it a function in functions.php and call that function somewhere) $args = array( ‘nopaging’ => true, // Loop through all posts at once ‘meta_key’ => ‘YOUR_CUSTOM_FIELD_NAME’, // Replace with the name of your custom field ‘meta_value’ => ‘YOUR_CUSTOM_FIELD_VALUE’, // The value of that field … Read more

How to change post status link order(priority) on cpt listing page

Turns out you can use this filter to alter the priority of the post_status links: https://github.com/WordPress/WordPress/blob/5c6b63d3a6874743542d6cede307c98ee370af23/wp-admin/includes/class-wp-list-table.php#L378 $views = apply_filters( “views_{$this->screen->id}”, $views ); If your custom post type is ‘inbound-email’ then the applied filter will look like this: add_filter( ‘views_edit-inbound-email’ , ‘function_to_filter_priority’ ); /** * rebuild priority of post status links * @param ARRAY $links * … Read more

How to filter posts in admin by before date or by post status ‘future’?

The question pretty much got covered in another thread here. In case anyone else need anything like this I ended up using following code to hide all the posts that are over a week in the future. function hide_future_posts($where, $q) { if(is_admin() && $q->is_main_query() && !filter_input(INPUT_GET, ‘post_status’) && ( $screen = get_current_screen() ) instanceof \WP_Screen … Read more

Custom Post Status & Taxonomies

Did you try adding a count callback? // Register Custom Taxonomy function custom_taxonomy() { $labels = array( ‘name’ => _x( ‘Taxonomies’, ‘Taxonomy General Name’, ‘text_domain’ ), ‘singular_name’ => _x( ‘Taxonomy’, ‘Taxonomy Singular Name’, ‘text_domain’ ), ‘menu_name’ => __( ‘Taxonomy’, ‘text_domain’ ), ‘all_items’ => __( ‘All Items’, ‘text_domain’ ), ‘parent_item’ => __( ‘Parent Item’, ‘text_domain’ ), … Read more