coloring row’s background based on custom field value
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 ); … Read more