WordPress.org

Ready to get started?Download WordPress

Forums

Making Category and Title required fields (2 posts)

  1. ko_chin
    Member
    Posted 3 years ago #

    Hello all!

    I have several questions so I'm seperating them out into different topics.

    I've been asked to make the categories and title required fields. Does anyone have any idea on how to do this without making changes to the base source code?

    I looked around online and on the forum and didn't come across anything useful though I did see something about custom fields which seemed more complicated than I needed.

    Basically when a person is posting, we don't want them to be able to publish the post live (draft is ok) without the post containing some sort of title (as long as its not blank) and without choosing a category of some type.

    I know that you can default the category to something but since we have several options and no blanket default, that idea doesn't work for us. Instead we need to require the user to choose at least one or more categories before publishing.

    Thoughts? Thanks!

  2. kkarpieszuk
    Member
    Posted 3 years ago #

    two ideas:

    1. change user role to 'editor'. then this person will only save drafts, then you will check title and category

    or

    2. you can use action hack 'post_update' but then afaik you can only add some predefined title and category, if you want. or check if title and category is added and if not - set status to draft

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.