Added: Clean Up settings

This commit is contained in:
Hoang Huu
2020-06-04 14:13:29 +07:00
parent c6a75c3b49
commit 13bc6c7ea1
13 changed files with 386 additions and 199 deletions

View File

@@ -25,6 +25,8 @@ class Opalestate_Admin_Property {
// add_action( 'transition_post_status', array( __CLASS__, 'save_post' ), 10, 3 );
add_action( 'parse_query', [ $this, 'search_custom_fields' ] );
add_filter( 'display_post_states', [ $this, 'display_post_states' ], 10, 2 );
}
/**
@@ -183,6 +185,20 @@ class Opalestate_Admin_Property {
$wp->query_vars['post__in'] = array_merge( $post_ids, [ 0 ] );
}
}
/**
* Filters the default post display states used in the posts list table.
*
* @param string[] $post_states An array of post display states.
* @param WP_Post $post The current post object.
*/
public function display_post_states( $post_states, $post ) {
if ( 'expired' == $post->post_status ) {
$post_states['expired'] = _x( 'Expired', 'post status', 'opalestate-pro' );
}
return $post_states;
}
}
new Opalestate_Admin_Property();