WordPress.org

Ready to get started?Download WordPress

Forums

Get category before post (1 post)

  1. nlehman
    Member
    Posted 6 years ago #

    I am trying to prompt my users to use a category. So I would like to be able to see if they have selected (checked) any categories when they click on the publish button. I tried to edit the publish button input field by adding a javascript confirm dialog, but I can't determine if they have selected any categories. I can only see the default category if I use $post->post_category.

    There must be a way to get the category before it is written to the database. I can use a filter to modify the category or at least recognize that they category hasn't been set but by that time the post has already been published.

Topic Closed

This topic has been closed to new replies.

About this Topic