0

I currently wrote a plugins to customize my wordpress website. I surprisly find it easy to do many things with hook. Now I want to make author not be able to push publish button if no category is choosed ( I don't want uncategorized article and force author to choose something ) How I can did this with a little message telling to the user to choose a category when he try to click publish button if no category are checked.

thanks

5
  • 1
    You will need Javascript. How far can you get on this without help?
    – s_ha_dum
    Mar 6, 2014 at 23:54
  • you can force category selection before loading the post edit screen, see this answer.
    – Milo
    Mar 7, 2014 at 0:00
  • s_ha_dum : not really far because I don't know where to start ... and probably less far if you tell me I really need to use javascript. Possible to only use php and hook ? Milo 10: If I can avoid popup a page before to entered in the articles form will be great. If it's can happen directly on the same page. Mar 7, 2014 at 0:11
  • Unless you use Javascript, you can (probably) remove the publish button if no category is selected, but you would have to save with a category, then publish in a second action. The best approach would be PHP and Javascript, honestly.
    – s_ha_dum
    Mar 7, 2014 at 0:25
  • Here is a preview of what you are getting into unless there are changes in the latest version that might make it easier.
    – s_ha_dum
    Mar 7, 2014 at 0:32

1 Answer 1

0

I finally found somethings. Not directly by cod it but I find a already wrote plugins for this.

http://wordpress.org/plugins/force-post-category-selection/

Hope it's will help others wordpress user.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.