function add_custom_status_class( $classes, $class, $post_id ) {
if ( 'request' === get_post_type( $post_id ) ) {
$status = get_post_meta( $post_id, 'hrs_field_status', true );
if ( $status === 'accepted' ) {
$classes[] = 'status-accepted';
} elseif ( $status === 'rejected' ) {
$classes[] = 'status-rejected';
}
}
return $classes;
}
add_filter( 'post_class', 'add_custom_status_class', 10, 3 );
function custom_admin_css() {
wp_enqueue_style( 'custom-admin-css', get_stylesheet_directory_uri() . '/custom-admin.css', array(), '1.0.0', 'all' );
}
add_action( 'admin_enqueue_scripts', 'custom_admin_css', 999 );
Related Posts:
- Filter by custom field in custom post type on admin page
- How can I remove the “Add New” button in my custom post type?
- Media library – Limit images to custom post type
- How to remove Filters from post admin page?
- Custom sortable columns ordered by meta-value?
- Adding a drag and drop re-ordering from a custom post type default list [closed]
- How can I filter posts by post_parent in the admin?
- How do I filter the excerpt metabox description in admin?
- How do I Filter Custom Post Type by Custom Taxonomy in the newest WordPress RESTful API?
- Filter for “get_post_type_archive_link()”
- Filter by custom Field for Custom post type Admin Listing
- WP Admin default view mode for Custom Post Type
- Remove wpautop from all posts/pages except my custom post type
- Remove date and category filters when editing custom post types
- Taxonomy terms with edit/filter link in wp-admin, in the list of custom posts
- Make the ‘all’ filter default instead of ‘mine’ in a custom post type
- Exclude custom function content from certain pages
- Filter get_categories() for taxonomy term in WordPress
- Debug output during filter execution doesn’t work
- Multiple post types in archives (filter?)
- Unable to filter on field on edit.php page
- wp_query and comment_parent – select only posts with top level comments
- Highlight nav menu terms
- Want to filter only parent post in admin area
- Adding posts of custom type into the main feed
- Filters post in admin with dropdown select, custom post type
- Admin List Dynamic Heading
- What is better: Custom Fields vs Custom Taxonomies with Terms for perfomance, scalability and better user experience
- How can I add a column in the wp_list_table of the admin area?
- How to filter the description of a custom post type
- Add $more_link_text parameter to the_excerpt()
- Filter home_url for custom post type
- Add Content Exclusively to a Custom Post Type Feed
- Custom Taxonomy breaking pages permalinks
- Add html to cpt main page / admin edit.php
- register_taxonomy and register_post_type does not work [closed]
- Filter categories of posts with checkboxes
- WooCommerce product search titles only
- Custom query to filter posts that have current post as a taxonomy [closed]
- Why is conditionally loading a custom plugin’s code only on a specific custom post type causing the site content to disappear?
- Setting proper query for multiple custom admin filters
- How to query custom post types posts filtered by multiple custom taxonomies through a form selection
- Genesis filterable portfolio isotope [closed]
- How can I see a list of my Custom Post Types of the last term I was in?
- filter custom post type by meta key in dashboard
- Categories of custom taxonomy don’t show any posts
- How to add a post slug to a url?
- How to filter wp_list_categories output with some custom post type meta query?
- How to Filter custom post type by taxonomy?
- creat filter with wp_query
- A method for ordering mixed dates in search result loop (theory only, no actual code)
- How to change the post type a theme shows by default?
- filter custom post in rest api with custom function
- Filter hierarchical custom post type admin page by parent, and include children & grandchildren
- Sort and filter custom post type posts by custom taxonomy
- Versioned Custom Post Type (Not the same as revisions)
- the_content filter on some post types only not working
- Custom filter function not working with Custom post type
- Filter Posts from the Main Query
- Categories filtering in new post
- wordpress remove views from action links in a custom post
- Filter posts by tax (dropdown) and meta value
- sortable columns for multiple custom post types not working
- I need to add a filter to prepend the term ‘National – ‘ to the post title if the post is tagged to multiple states
- Problem with Apply Filters on URL in meta box filed of custom port type
- Modifying WP_Title For Custom Post Type
- Change Custom Post Type singular_name through function/filter
- Catch and display error on save_post action
- show most viewed posts of last days by link?
- Is possible register two archive pages for single custom post type?
- Display custom post front end filter by ACF equals current user
- Custom Permalink For Custom Post Type – Working Fine But Broken For Pagination
- Best way to fix bad count on All | Mine | Published
- Display category filters for custom post type when category is shared by multiple post types
- Filter in Custom post type to find the parent post
- Create Post Types from a XML url (Real Estate website)
- Add content to wordpress edit.php page
- How to use multiple orderby conditions on query search results? (orderby one post type, relevance)
- pricefilter without WooCommerce
- filter rest api post by a acf filed
- Keep br tags from stripping
- Add filter button to custom post type in admin area
- Grouping and paging CPT events by month with custom field date
- Highlight a Post on archive page if it has a new comment?
- Adding Information To All Posts Screen
- Filter Content on all Post Types
- Custom post type with Filter and Page Nav
- Converting a checkbox filter for custom fields to a dropdown
- Exclude Custom Post Type from shared Custom Taxonomy
- Diffrent search templates for different post types
- How to filter posts by categories?
- How do I filter a custom post type loop by a field?
- A to Z list for custom post types
- Trying to set up a range filter for related custom post types
- Filter page ID outside the loop and order
- Paginate yearly archives for a custom post type
- Custom post type template not loading from plugin
- Show only taxonomy types terms associated with a custom post type in WordPress PHP
- How can I filter records in a custom post type list in the admin based on the ACF field in the post that contains the current user?
- Modify wp_title for custom post types using custom fields data?