• Hello,

    This is regarding the tables that lists posts in the wordpress admin. I need to be able to add a conditional class to the rows on a custom post type. I think the same would probably apply to the inbuilt posts/pages post types too.

    The end goal is to highlight all rows that have today’s date. The custom post type is an activity log so there’s lots of activities being added every day. And we need to be able to highlight all activities that were added today for speed and to make things clear. Being able to add a dynamic class to the rows will also give us flexibility to highly rows in different colours for different conditions.

    To achieve this I hoped there was a hook where I could add a class to row after testing if the post’s date is today. So the hook would need to pass the post’s ID as well so we could do the tests.

    Looking into the core code there doesn’t seem to be any hooks for the rows, apart from the “post_row_actions”, which only edits the actions.

    Does anyone know of any other hooks available for rows?

    Many thanks,
    Steven

  • The topic ‘Highlight custom posts with todays date admin list’ is closed to new replies.