{"id":12145,"date":"2011-02-14T14:42:10","date_gmt":"2011-02-14T14:42:10","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/require-post-category\/"},"modified":"2024-04-05T05:51:38","modified_gmt":"2024-04-05T05:51:38","slug":"require-post-category","status":"publish","type":"plugin","link":"https:\/\/pcd.wordpress.org\/plugins\/require-post-category\/","author":7561060,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"2.1","stable_tag":"2.1","tested":"6.5.8","requires":"5.5","requires_php":"","requires_plugins":null,"header_name":"Require Post Category","header_author":"Josh Hartman","header_description":"","assets_banners_color":"999986","last_updated":"2024-04-05 05:51:38","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"https:\/\/wordpress.org\/plugins\/require-post-category\/","header_author_uri":"https:\/\/www.warpconduit.net","rating":4.9,"author_block_rating":0,"active_installs":1000,"downloads":26752,"num_ratings":11,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":{"1.0":{"tag":"1.0","author":"joshhartman","date":"2020-02-03 08:05:59"},"1.0.1":{"tag":"1.0.1","author":"joshhartman","date":"2020-02-03 08:05:59"},"1.0.2":{"tag":"1.0.2","author":"joshhartman","date":"2020-02-03 08:05:59"},"1.0.3":{"tag":"1.0.3","author":"joshhartman","date":"2020-02-03 08:05:59"},"1.0.4":{"tag":"1.0.4","author":"joshhartman","date":"2020-02-03 08:05:59"},"1.0.5":{"tag":"1.0.5","author":"joshhartman","date":"2020-02-03 08:05:59"},"1.0.6":{"tag":"1.0.6","author":"joshhartman","date":"2020-02-03 08:05:59"},"1.0.7":{"tag":"1.0.7","author":"joshhartman","date":"2020-02-03 08:05:59"},"1.1":{"tag":"1.1","author":"joshhartman","date":"2020-02-03 08:05:59"},"2.0":{"tag":"2.0","author":"joshhartman","date":"2020-02-04 17:35:47"},"2.0.1":{"tag":"2.0.1","author":"joshhartman","date":"2020-02-04 17:35:47"},"2.0.2":{"tag":"2.0.2","author":"joshhartman","date":"2020-02-06 04:52:09"},"2.0.3":{"tag":"2.0.3","author":"joshhartman","date":"2020-03-12 06:46:13"},"2.1":{"tag":"2.1","author":"joshhartman","date":"2024-04-05 05:51:38"}},"upgrade_notice":[],"ratings":{"1":0,"2":0,"3":0,"4":"1","5":"10"},"assets_icons":{"icon-128x128.png":{"filename":"icon-128x128.png","revision":1603108,"resolution":"128x128","location":"assets","locale":""},"icon-256x256.png":{"filename":"icon-256x256.png","revision":1603108,"resolution":"256x256","location":"assets","locale":""}},"assets_banners":{"banner-1544x500.png":{"filename":"banner-1544x500.png","revision":1603108,"resolution":"1544x500","location":"assets","locale":""},"banner-772x250.png":{"filename":"banner-772x250.png","revision":1603108,"resolution":"772x250","location":"assets","locale":""}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0","1.0.1","1.0.2","1.0.3","1.0.4","1.0.5","1.0.6","1.0.7","1.1","2.0","2.0.1","2.0.2","2.0.3","2.1"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":3065195,"resolution":"1","location":"plugin"},"screenshot-2.png":{"filename":"screenshot-2.png","revision":3065195,"resolution":"2","location":"plugin"}},"screenshots":{"1":"Notice appears when editing a post without selecting a category (Gutenberg)","2":"Alert appears when you try to save a post without selecting a category (Classic)"},"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[89,86,5653,609,91],"plugin_category":[57],"plugin_contributors":[80757],"plugin_business_model":[],"class_list":["post-12145","plugin","type-plugin","status-publish","hentry","plugin_tags-category","plugin_tags-post","plugin_tags-require","plugin_tags-tags","plugin_tags-taxonomy","plugin_category-taxonomy","plugin_contributors-joshhartman","plugin_committers-joshhartman"],"banners":{"banner":"https:\/\/ps.w.org\/require-post-category\/assets\/banner-772x250.png?rev=1603108","banner_2x":"https:\/\/ps.w.org\/require-post-category\/assets\/banner-1544x500.png?rev=1603108","banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":false,"icon":"https:\/\/ps.w.org\/require-post-category\/assets\/icon-128x128.png?rev=1603108","icon_2x":"https:\/\/ps.w.org\/require-post-category\/assets\/icon-256x256.png?rev=1603108","generated":false},"screenshots":[{"src":"https:\/\/ps.w.org\/require-post-category\/trunk\/screenshot-1.png?rev=3065195","caption":"Notice appears when editing a post without selecting a category (Gutenberg)"},{"src":"https:\/\/ps.w.org\/require-post-category\/trunk\/screenshot-2.png?rev=3065195","caption":"Alert appears when you try to save a post without selecting a category (Classic)"}],"raw_content":"<!--section=description-->\n<p>Tired of uncategorized posts? Use this simple plugin to require users to choose a post category before updating or publishing a post. By default this only applies to normal posts. If you wish to require a category\/taxonomy for a custom post type see the FAQ for filter hook usage examples.<\/p>\n\n<h4>Translators<\/h4>\n\n<ul>\n<li>French (fr_FR) - Dominique V.<\/li>\n<li>Spanish (es_ES) - <a href=\"http:\/\/www.webhostinghub.com\">Andrew Kurtis - WebHostingHub<\/a><\/li>\n<li>Polish (pl_PL) - Micha\u0142 Papli\u0144ski<\/li>\n<li>Finnish (fi) - Sanapaino<\/li>\n<\/ul>\n\n<p>If you have created your own language pack, or have an update of an existing one, you can send the <a href=\"https:\/\/codex.wordpress.org\/Translating_WordPress\">PO and MO files<\/a> to <a href=\"https:\/\/www.warpconduit.net\/contact\">me<\/a> so that I can bundle it into the plugin. <a href=\"https:\/\/plugins.svn.wordpress.org\/require-post-category\/trunk\/languages\/require-post-category.pot\">Download the latest POT file<\/a>.<\/p>\n\n<!--section=installation-->\n<h4>From your WordPress dashboard<\/h4>\n\n<ol>\n<li>Visit 'Plugins &gt; Add New'<\/li>\n<li>Search for 'require post category' and click the Install button<\/li>\n<li>Activate Require Post Category from your Plugins page.<\/li>\n<\/ol>\n\n<h4>From WordPress.org<\/h4>\n\n<ol>\n<li>Download Require Post Category.<\/li>\n<li>Upload the 'require-post-category' directory to your '\/wp-content\/plugins\/' directory, using your favorite method (ftp, sftp, scp, etc...)<\/li>\n<li>Activate Require Post Category from your Plugins page.<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt id='are%20there%20any%20settings%20i%20can%20adjust%3F'><h3>Are there any settings I can adjust?<\/h3><\/dt>\n<dd><p>Nope, just install and activate, that's it!<\/p><\/dd>\n<dt id='how%20do%20i%20use%20this%20for%20custom%20post%20types%20and%2For%20custom%20taxonomies%3F'><h3>How do I use this for custom post types and\/or custom taxonomies?<\/h3><\/dt>\n<dd><p>Use the <code>rpc_post_types<\/code> filter hook in your theme's <code>functions.php<\/code> or a must-use plugin.<\/p>\n\n<p>Usage examples:<\/p>\n\n<pre><code>function custom_rpc_post_types( $post_types ) {\n    \/\/ Add a key to the $post_types array for each post type and list the slugs of the taxonomies you wish to require\n\n    \/\/ Simplest usage\n    $post_types['book'] = array( 'genre' );\n\n    \/\/ Multiple taxonomies\n    $post_types['recipe'] = array( 'cookbook_category', 'geographic_origin', 'flavor_tags' );\n\n    \/\/ Set your own alert message for each taxonomy, or let the plugin generate the alert message\n    $post_types['inventory'] = array(\n        \/\/ Let the plugin generate a relevant alert message\n        'manufacturer',\n        \/\/ Or specify a custom alert message\n        'inventory_category' =&gt; array(\n            'message' =&gt; \"Please choose a category for this fine inventory item.\"\n        )\n    );\n\n    \/\/ Always return $post_types after your modifications\n    return $post_types;\n}\n\nadd_filter( 'rpc_post_types', 'custom_rpc_post_types' );\n<\/code><\/pre>\n\n<p>The default <code>$post_types<\/code> contains the following:<\/p>\n\n<pre><code>$post_types['post'] = array(\n    'category' =&gt; array(\n        'message' =&gt; 'Please select a category before publishing this post.'\n    )\n);\n<\/code><\/pre>\n\n<p>This maintains the plugin's original functionality. However, you can remove this functionality with <code>unset($post_types['post']);<\/code> or by redefining <code>$post_types<\/code> in your hook function.<\/p><\/dd>\n<dt id='you%E2%80%99ve%20added%20code%20to%20require%20a%20custom%20taxonomy%20but%20can%E2%80%99t%20get%20it%20to%20work%20in%20the%20gutenberg%20editor%3F'><h3>You\u2019ve added code to require a custom taxonomy but can\u2019t get it to work in the Gutenberg editor?<\/h3><\/dt>\n<dd><p>One reason may be that your custom taxonomy does not have the <code>show_in_rest<\/code> argument enabled. Without it enabled the Gutenberg editor cannot access it.<\/p><\/dd>\n<dt id='have%20a%20question%20that%20is%20not%20addressed%20here%3F'><h3>Have a question that is not addressed here?<\/h3><\/dt>\n<dd><p>Visit this plugin's WordPress support forum at https:\/\/wordpress.org\/support\/plugin\/require-post-category<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>2.1<\/h4>\n\n<ul>\n<li>Updated for WordPress 5.5<\/li>\n<li>FIXED: Deprecated function notice listed in jQuery Migrate Helper plugin (Classic Editor)<\/li>\n<li>FIXED: Submitting post form by pressing enter in the title field would bypass checks (Classic Editor)<\/li>\n<\/ul>\n\n<h4>2.0.3<\/h4>\n\n<ul>\n<li>Added Finnish (fi) translation by Sanapaino<\/li>\n<\/ul>\n\n<h4>2.0.2<\/h4>\n\n<ul>\n<li>FIXED: Custom taxonomy <code>rest_base<\/code> value of boolean false was not being properly handled.<\/li>\n<\/ul>\n\n<h4>2.0.1<\/h4>\n\n<ul>\n<li>Repaired translation files.<\/li>\n<\/ul>\n\n<h4>2.0<\/h4>\n\n<ul>\n<li>Rewritten for the new Gutenberg editor (first introduced in WordPress 5.0)<\/li>\n<\/ul>\n\n<h4>1.1<\/h4>\n\n<ul>\n<li>NEW: Added a filter hook and related code to allow developers to easily add support for custom post types and custom taxonomies<\/li>\n<li>Updated to meet WordPress PHP coding standards<\/li>\n<\/ul>\n\n<h4>1.0.7<\/h4>\n\n<ul>\n<li>Moved JavaScript to separate file and updated to use <code>wp_enqueue_script<\/code> and <code>wp_localize_script<\/code><\/li>\n<\/ul>\n\n<h4>1.0.6<\/h4>\n\n<ul>\n<li>Added French (fr_FR) translation by Dominique V.<\/li>\n<\/ul>\n\n<h4>1.0.5<\/h4>\n\n<ul>\n<li>Added Polish (pl_PL) translation by Micha\u0142 P.<\/li>\n<\/ul>\n\n<h4>1.0.4<\/h4>\n\n<ul>\n<li>Added Spanish (es_ES) translation by Andrew K.<\/li>\n<\/ul>\n\n<h4>1.0.3<\/h4>\n\n<ul>\n<li>Added i18n support<\/li>\n<\/ul>\n\n<h4>1.0.2<\/h4>\n\n<ul>\n<li>Updated for WordPress 3.6<\/li>\n<\/ul>\n\n<h4>1.0.1<\/h4>\n\n<ul>\n<li>FIXED: Disabled script when adding\/editing pages<\/li>\n<\/ul>\n\n<h4>1.0<\/h4>\n\n<ul>\n<li>First stable release<\/li>\n<\/ul>","raw_excerpt":"Require users to choose a post category before updating or publishing a post.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/12145","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=12145"}],"author":[{"embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/joshhartman"}],"wp:attachment":[{"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=12145"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=12145"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=12145"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=12145"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=12145"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=12145"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}