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:
- single-{$post_type}-{slug}.php for custom post types
- Row actions for custom post types?
- remove custom post type permalink
- Saving Taxonomy Terms
- Sort search results by post type
- How to order posts of a custom post type by date DESC in dashboard Admin?
- How to change “Draft” string for status of custom post type to “Unavailable”?
- How to correctly get post type in a the_title filter
- How to add a CSS class to every image in a Custom Post Type
- Best way to filter featured image text for a custom post type?
- How can I get next/ previous post links to order by a filter (by the last word of the title)?
- Most efficient way to search for values from CPT in Post content
- post_type_link filter causes 404 on the CPT page it’s used on
- Title_save_pre – Simple problem that u know for sure
- Ajax filter with custom taxonomies
- Filter posts with ajax form and checkboxes
- Image size filtering in Media uploader according to custom post type
- How to remove CPT comment feed from head?
- wp_query and comment_parent – select only posts with top level comments
- Help with issues on “Adding a Taxonomy Filter to Admin List for a Custom Post Type?”
- Used with meta_query in query_posts works slowly
- Hooking into wp_export filter for custom post type [closed]
- Custom Post Row Actions
- How can I add a column in the wp_list_table of the admin area?
- Archive filter disappears on no results?
- How to filter the description of a custom post type
- Remove “Get Shortlink” button in admin of custom post type
- Filter home_url for custom post type
- How to get Custom Post ID by adding filter to child theme’s function
- How do I set the link in the Custom Post Type admin menu?
- Filter custom post type archive page with custom taxonomies (categories) with AJAX
- How to filter out post type meta?
- How to check if “is single” page
- Make a function to run only for CPTs
- Modifying date filter on admin page for custom post type to link to custom field
- Pre_get_posts filter overwrites all search functionality
- How to detect filter in URL in Category page?
- Append date to custom post type url slug
- Filtering WP_Query
- Displaying custom taxonomy in the admin list of a custom post type
- How can I run this code once so that my generated post title doesn’t keep changing on publish/update?
- WordPress sort search results by custom order
- Filter term taxonomy metabox in custom post type
- How can I made custom taxonomies relationship?
- WooCommerce sort products by the actual product width(not the shipping width)
- How to change the post type a theme shows by default?
- Loop filtering Custom Post Types and/or Categories
- search suggest – filter post type
- Filtering posts list table
- How to use manage_$post_type_posts_columns with underscore in post type?
- How does the filter post_updated_messages work?
- How to order posts of a custom post type by date DESC in dashboard Admin?
- How can I add a filter to a particular post format?
- Is there any way to get list of all possible filter hooks for all post types?
- Can I display custom post types in home.php or need page template?
- Create new custom post and post category of same name
- wp_insert_post wrong post type [closed]
- How do I add custom HTML to the content of an archive page’s posts?
- Only show posts with a specific term of an associated taxonomy in a custom post type archive
- REST filters only firing when I have a param set
- How do I show a link or ‘Read More’ button on a custom field excerpt when it is less than the word limit
- How to filter url on post submission?
- Filtering the_content, but still need to display the unfiltered content inside filter
- Modify a plugin function output from another plugin
- Custom Taxonomy Filter Issues
- Filter search posts by post meta?
- Modifying search results based on post_type
- Remove filter and view options from custom post type edit screen
- custom filtering admin columns
- Ajax Post Filter | Split Taxonomy Into minPrice & maxPrice
- Query filter by value in meta_value array
- WP Admin Dropdown List Filter for custom (ACF) field on custom post type(s)
- Is there any filter to add a custom attribute to the tag in admin panel?
- Store a value in global scope after init hook is fired
- Dynamic page for nav items used as filters
- Filter posts by their related field’s custom field
- Post Click Redirect to Custom URL instead of Single Post Page
- How can I add image sizes for a specific custom post type?
- Output all terms slugs for a loop filter
- Group Custom Posts Types in a Relation field of ACF
- Help Adding filter to Add Media button for custom post type
- Apply pre_get_posts to specific custom post type in the admin area
- Enable shortcodes on custom post type
- Filter between Custom Posts depending on meta_value
- Creating adminable dynamic filtering on custom post type
- Dropdown switching subcategories portfolio
- Filter wp_dropdown_categories Per Post Type
- Sorting on Taxonomy in archive page
- add current-menu-item to multiple custom post types
- Filter custom post type by tags
- Custom Search Template for Custom Post Types
- Hook only specific post type
- Restrict a filter to a custom post type. Am I doing this right?
- Rewrite a filter as shortcode (or something like that) to use anywhere in CPT
- add_filter > posts_where works partially
- Simple Share Buttons Add Plugin and Custom Post Type
- Can WordPress show posts based on a button that the user clicked 2 pages back?
- When Attempting to Filter Plugin Generated Content Using Filter post_type_link, Permalinks Are Not Modified
- Add Custom Taxonomy Terms as CSS Classes for CPT Posts in an Elementor Loop Item Template
- Add post id to url instead of WordPress default -2 suffix