{"id":115851,"date":"2020-01-09T08:22:38","date_gmt":"2020-01-09T08:22:38","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/shortcode-directives\/"},"modified":"2020-01-09T09:01:06","modified_gmt":"2020-01-09T09:01:06","slug":"shortcode-directives","status":"publish","type":"plugin","link":"https:\/\/tah.wordpress.org\/plugins\/shortcode-directives\/","author":10206293,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"1.0.0","stable_tag":"1.0.0","tested":"5.3.21","requires":"4.5","requires_php":"5.2.4","requires_plugins":"","header_name":"Shortcode Directives","header_author":"Michael Uno","header_description":"Enables shortcode directives that perform certain actions on posts and comments.","assets_banners_color":"2c2c2c","last_updated":"2020-01-09 09:01:06","external_support_url":"","external_repository_url":"","donate_link":"http:\/\/en.michaeluno.jp\/donate","header_plugin_uri":"http:\/\/en.michaeluno.jp\/shortcode-directivies","header_author_uri":"http:\/\/en.michaeluno.jp","rating":0,"author_block_rating":0,"active_installs":0,"downloads":1039,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","changelog"],"tags":[],"upgrade_notice":[],"ratings":[],"assets_icons":{"icon-128x128.jpg":{"filename":"icon-128x128.jpg","revision":"2224680","resolution":"128x128","location":"assets","locale":""},"icon-256x256.jpg":{"filename":"icon-256x256.jpg","revision":"2224680","resolution":"256x256","location":"assets","locale":""}},"assets_banners":{"banner-772x250.jpg":{"filename":"banner-772x250.jpg","revision":"2224680","resolution":"772x250","location":"assets","locale":""}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0.0"],"block_files":[],"assets_screenshots":{"screenshot-1.jpg":{"filename":"screenshot-1.jpg","revision":"2224680","resolution":"1","location":"assets","locale":""},"screenshot-2.jpg":{"filename":"screenshot-2.jpg","revision":"2224680","resolution":"2","location":"assets","locale":""}},"screenshots":{"1":"<strong>Some Image<\/strong>","2":"<strong>Another Image<\/strong>"},"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[22679,54272,107,166,80],"plugin_category":[43,44],"plugin_contributors":[79958,79959],"plugin_business_model":[],"class_list":["post-115851","plugin","type-plugin","status-publish","hentry","plugin_tags-command","plugin_tags-commands","plugin_tags-comments","plugin_tags-posts","plugin_tags-shortcode","plugin_category-customization","plugin_category-discussion-and-community","plugin_contributors-michael-uno","plugin_contributors-miunosoft","plugin_committers-miunosoft"],"banners":{"banner":"https:\/\/ps.w.org\/shortcode-directives\/assets\/banner-772x250.jpg?rev=2224680","banner_2x":false,"banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":false,"icon":"https:\/\/ps.w.org\/shortcode-directives\/assets\/icon-128x128.jpg?rev=2224680","icon_2x":"https:\/\/ps.w.org\/shortcode-directives\/assets\/icon-256x256.jpg?rev=2224680","generated":false},"screenshots":[{"src":"https:\/\/ps.w.org\/shortcode-directives\/assets\/screenshot-1.jpg?rev=2224680","caption":"<strong>Some Image<\/strong>"},{"src":"https:\/\/ps.w.org\/shortcode-directives\/assets\/screenshot-2.jpg?rev=2224680","caption":"<strong>Another Image<\/strong>"}],"raw_content":"<!--section=description-->\n<h4>Quickly manage posts\/comments in front-end with command-like-shortcodes<\/h4>\n\n<p>Say, you find a comment that should be hidden or deleted on your site. Usually, you click on the Edit link of the comment and manage it back-end.<\/p>\n\n<p>What if you could delete\/hide it by commenting on it?<\/p>\n\n<p>This plugin lets you manage posts and comments with command-like-shortcodes.<\/p>\n\n<p>In this case, you reply to the <em>comment<\/em> you want to hide by typing <code>[$comment hold]<\/code>.<\/p>\n\n<h4>Bulk actions on certain posts\/comments<\/h4>\n\n<p>If you want to bulk-delte comments that belong to a certain post, comment on the <em>post<\/em> by typing <code>[$comment delete]<\/code>.<\/p>\n\n<p>If you have a hierarchical post type and want to add the same tag to all direct children of a certain post plus the post itself, then comment on the post by typing <code>[$tag mytag --to=\"siblings,self\"]<\/code>.<\/p>\n\n<p>Like this, a bit complex operations can be achived with the shortcode directives.<\/p>\n\n<h4>Getting Started<\/h4>\n\n<p>To experience what this plugin does, follow these steps.\n1. After activating the plugin, pick a test post which has been published already.\n2. Go to the page of the post in front-end.\n3. Submit a comment to the post with the shortcode <code>[$post_status private]<\/code>.<\/p>\n\n<p>Now it should be hidden for normal site visitors.<\/p>\n\n<ol>\n<li>To revert the change, submit a comment to the post with the shortcode <code>[$post_status publish]<\/code>.<\/li>\n<\/ol>\n\n<p>It should be visible to normal site visitors.<\/p>\n\n<p>By default, the plugin enables the features for the buil-in <code>post<\/code> and <code>page<\/code> post types. If you like to support different post types, go to Dashboard -&gt; Tools -&gt; Shortcode Directives. There, you can pick which post types to have the ability of shortcode directives.<\/p>\n\n<p>For usage details, please see the <strong>Other Notes<\/strong> seciton.<\/p>\n\n<p>You should have grapsed the idea of how this plugin works by now. Hope you find it useful!<\/p>\n\n<h4>Supported Languages<\/h4>\n\n<ul>\n<li>English<\/li>\n<\/ul>\n\n<h3>Usage<\/h3>\n\n<h4>$post_status<\/h4>\n\n<p>Sets a specified post status.\n<strong>Format<\/strong><\/p>\n\n<pre><code>[$post_status {status}]\n<\/code><\/pre>\n\n<p><strong>Examples<\/strong>\nChanges the post status to <code>pending<\/code>.<\/p>\n\n<pre><code>[$post_status pending]\n<\/code><\/pre>\n\n<p>Changes the post status to <code>draft<\/code>.<\/p>\n\n<pre><code>[$post_status draft]\n<\/code><\/pre>\n\n<p><strong>Option: --to<\/strong>\nSpecifies which post to apply the directive operation. This <code>--to<\/code> option is avialble for all the directives except <code>$comment<\/code>. Use <code>children<\/code>, <code>siblings<\/code>, and <code>descendants<\/code> for builk actions.\n- self (default): the comment\/post iteself. When a comment with a directive is submitted to a post, that post will be the subject post and it is considered the one denoted by the option value, <code>self<\/code>.\n- parent: the parent post of the subject post.\n- {post ID}: the post ID.\n- children: the direct child posts of the subjec post if the post type supports the <code>hierarchical<\/code> option.\n- siblings: the sibling posts of the subject post in hierarchical relationships if the post type supports the <code>hierarchical<\/code> option.\n- decendants: all the decendants which belong to the subject post if the post type supports the <code>hierarchical<\/code> option.<\/p>\n\n<p>This moves all the descendant posts to trash.<\/p>\n\n<pre><code>[$post_status trash --to=descendants]\n<\/code><\/pre>\n\n<h4>$post_parent<\/h4>\n\n<p>Sets a post parent ID.\n<strong>Format<\/strong><\/p>\n\n<pre><code>[$post_parent {post ID}]\n<\/code><\/pre>\n\n<p>Sets a post parent of a post ID of 1451.<\/p>\n\n<pre><code>[$post_parent 1451]\n<\/code><\/pre>\n\n<p>This removes a post parent.<\/p>\n\n<pre><code>[$post_parent 0]\n<\/code><\/pre>\n\n<p><strong>Option: --to<\/strong>\nThe same option values are supported described in the <code>$post_status<\/code> section above.<\/p>\n\n<h4>$post_column<\/h4>\n\n<p>Sets a value with a specified post column name to an existent post column.\n<strong>Format<\/strong><\/p>\n\n<pre><code>[$post_column --column={colum name} {value}]\n[$post_column --column={colum name} --value=\"some value\"]\n<\/code><\/pre>\n\n<p>Setting the value <code>3<\/code> to the <code>menu_order<\/code> column.<\/p>\n\n<pre><code>[$post_column column=menu_order 3]\n<\/code><\/pre>\n\n<p>When a value must have a white space, use the <code>--value<\/code> option.<\/p>\n\n<pre><code>[$post_column --column=post_title --value=\"This is a title\"]\n<\/code><\/pre>\n\n<p><strong>Option: --to<\/strong>\nThe same option values are supported described in the <code>$post_status<\/code> section above.<\/p>\n\n<h4>$post_meta<\/h4>\n\n<p>Sets a post meta value.\n<strong>Format<\/strong><\/p>\n\n<pre><code>[$post_meta {key} {value}]\n[$post_meta {key1}=\"{some value1}\" {key2}=\"{some value2}\" {key3}=\"{some value3}\"...]\n<\/code><\/pre>\n\n<p>This sets the post meta value <code>bar<\/code> to the <code>_foo<\/code> meta key.<\/p>\n\n<pre><code>[$post_meta _foo bar]\n<\/code><\/pre>\n\n<p>For values containing white-spaces and multiple key-value pairs, use the attribute style format.<\/p>\n\n<pre><code>[$post_meta _question=\"Why did the chicken cross the road?\" _answer=\"To get to the other side\"]\n<\/code><\/pre>\n\n<p>To delete meta keys, use the <code>--action<\/code> option by passing <code>delete<\/code>. This deletes the <code>_question<\/code> and <code>_answer<\/code> meta keys and their values from the database.<\/p>\n\n<pre><code>[$post_meta _question _answer --action=\"delete\"]\n<\/code><\/pre>\n\n<p>Note: the <code>--to<\/code> and <code>--action<\/code> option names are reserved by the plugin so you cannot specify them with the option name like <code>[$post_meta --action=\"my value\" --to=\"another value\"]<\/code>.<\/p>\n\n<p>If you have to set them, use the command-line style format introduced above.<\/p>\n\n<pre><code>[$post_meta --action \"Some value here.\"]\n[$post_meta --to \"Another value here.\"]\n<\/code><\/pre>\n\n<p><strong>Option: --to<\/strong>\nThe same option values are supported described in the <code>$post_status<\/code> section above.<\/p>\n\n<h4>$taxonomy<\/h4>\n\n<p>Sets taxonomy terms with a specified taxonomy slug.\n<strong>Format<\/strong><\/p>\n\n<pre><code>[$taxonomy --slug={taxonomy slug} {term1} {term2} {term3}...]\n<\/code><\/pre>\n\n<p>This adds the <code>Apple<\/code>, <code>Banana<\/code>, <code>Apple Pie<\/code> terms of the <code>post_tag<\/code> taxonomy to the post.<\/p>\n\n<pre><code>[$taxonomy --slug=post_tag Apple Banana \"Apple Pie\"]\n<\/code><\/pre>\n\n<p><strong>Option: --action<\/strong>\n- add (default) : adds the specified terms\n- remove : removes the specified terms\n- remove_all\/remove_all : removes all the associated terms\n- delete : deletes the specified terms from the database if they are assigned to the post\n- delete_all\/delete-all : deletes all the associated terms from the database<\/p>\n\n<p>This removes the <code>Apple<\/code>, <code>Banana<\/code>, <code>Apple Pie<\/code> terms of the <code>post_tag<\/code> taxonomy from the post.<\/p>\n\n<pre><code>[$taxonomy --slug=post_tag Apple Banana \"Apple Pie\" --action=remove]\n<\/code><\/pre>\n\n<p>This deletes the <code>Apple<\/code>, <code>Banana<\/code>, <code>Apple Pie<\/code> terms of the <code>post_tag<\/code> taxonomy from the database if they are assigned to the post.<\/p>\n\n<pre><code>[$taxonomy --slug=post_tag Apple Banana \"Apple Pie\" --action=delete]\n<\/code><\/pre>\n\n<p>This removes all the assigned terms of the <code>post_tag<\/code> taxonomy from the post.<\/p>\n\n<pre><code>[$taxonomy --slug=post_tag --action=remove_all]\n<\/code><\/pre>\n\n<p>This deletes all the assigned terms of the <code>post_tag<\/code> taxonomy from the database.<\/p>\n\n<pre><code>[$taxonomy --slug=post_tag --action=delete_all]\n<\/code><\/pre>\n\n<p><strong>Option: --to<\/strong>\nThe same option values are supported described in the <code>$post_status<\/code> section above.<\/p>\n\n<h4>$tag<\/h4>\n\n<p>Sets non-hierarchical taxonomy terms.\n<strong>Format<\/strong><\/p>\n\n<pre><code>[$tag {tag1} {tag2} {tag3}...]\n<\/code><\/pre>\n\n<p>When the <code>$tag<\/code> directive is given, the plugin searches for a non-hierarchical taxonomy associated with the post type of the post and sets the given terms to the post. If a non-hierarchical taxonomy is not found, no action will be taken. If you have multiple non-hierarchical taxonomies for a particular post type which supports shortcode directives, use the <code>$taxonomy<\/code> directive. See the <code>$taxonomy<\/code> section above.<\/p>\n\n<p>This adds the <code>Apple<\/code>, <code>Banana<\/code>, <code>Apple Pie<\/code> tags to the post.<\/p>\n\n<pre><code>[$tag Apple Banana \"Apple Pie\"]\n<\/code><\/pre>\n\n<p><strong>Option: --action<\/strong>\nThe same action values with the <code>$taxonomy<\/code> directive are supported.<\/p>\n\n<p>This removes the <code>Apple<\/code>, <code>Banana<\/code>, <code>Apple Pie<\/code> tags from the post.<\/p>\n\n<pre><code>[$tag --action=remove Apple Banana \"Apple Pie\"]\n<\/code><\/pre>\n\n<p>This deletes the <code>Apple<\/code>, <code>Banana<\/code>, <code>Apple Pie<\/code> terms from the database if they are assigned to the post.<\/p>\n\n<pre><code>[$tag --action=delete Apple Banana \"Apple Pie\"]\n<\/code><\/pre>\n\n<p>This removes all the tags associated with the post.<\/p>\n\n<pre><code>[$tag --action=remove_all]\n<\/code><\/pre>\n\n<p>This deletes all the tags associated with the post from the database.<\/p>\n\n<pre><code>[$tag --action=delete_all]\n<\/code><\/pre>\n\n<p><strong>Option: --to<\/strong>\nThe same option values are supported described in the <code>$post_status<\/code> section above.<\/p>\n\n<h4>$category<\/h4>\n\n<p>Sets hierarchical taxonomy terms.\n<strong>Format<\/strong><\/p>\n\n<pre><code>[$category {category1} {category2} {category3}...]\n<\/code><\/pre>\n\n<p>When the <code>$category<\/code> directive is given, the plugin searches for a hierarchical taxonomy associated with the post type of the post and sets the given terms to the post. If a hierarchical taxonomy is not found, no action will be taken. If you have multiple hierarchical taxonomies for a particular post type which supports shortcode directives, use the <code>$taxonomy<\/code> directive. See the <code>$taxonomy<\/code> section above.<\/p>\n\n<p>This adds the <code>Apple<\/code>, <code>Banana<\/code>, <code>Apple Pie<\/code> categories to the post.<\/p>\n\n<pre><code>[$category Apple Banana \"Apple Pie\"]\n<\/code><\/pre>\n\n<p>This removes the <code>Apple<\/code>, <code>Banana<\/code>, <code>Apple Pie<\/code> categories from the post.<\/p>\n\n<pre><code>[$category Apple Banana \"Apple Pie\" --action=remove]\n<\/code><\/pre>\n\n<p>This deletes the <code>Apple<\/code>, <code>Banana<\/code>, <code>Apple Pie<\/code> categories from the database if they are assigned to the post.<\/p>\n\n<pre><code>[$category --action=delete Apple Banana \"Apple Pie\"]\n<\/code><\/pre>\n\n<p>This removes all the categories associated with the post.<\/p>\n\n<pre><code>[$category --action=remove_all]\n<\/code><\/pre>\n\n<p>This deletes all the categories associated with the post from the database.<\/p>\n\n<pre><code>[$category --action=delete_all]\n<\/code><\/pre>\n\n<p><strong>Option: --action<\/strong>\nThe same action values with the <code>$taxonomy<\/code> directive are supported.<\/p>\n\n<p><strong>Option: --to<\/strong>\nThe same option values are supported described in the <code>$post_status<\/code> section above.<\/p>\n\n$comment\n\n<p>Performs certain actions againt a replying comment. If commented on a post, the action applied to <em>all<\/em> the comments which belong to the post. So be careful not to do that when you want to do someting on a single comment.<\/p>\n\n<p><strong>Format<\/strong><\/p>\n\n<pre><code>[$comment {sub-command}]\n<\/code><\/pre>\n\n<p><strong>Sub-commands<\/strong>\n- delete|remove: deletes the comment\n- hold|disapprove: changes the comment status to <code>hold<\/code>.\n- trash: moves the comment to trash\n- spam: mark the commet as spam\n- convert: converts the comment to a child post.<\/p>\n\n<p>Replying to an existent comment with the following deletes the comment.<\/p>\n\n<pre><code>[$comment delete]\n<\/code><\/pre>\n\n<p>For hierarchical post types, the <code>convert<\/code> sub-command can help bulk-convert comments in to posts.<\/p>\n\n<p>Commenting on a <em>post<\/em> (not an existent comment) converts all the comments belonging to the post into posts by keeping the hirarchical relationships.<\/p>\n\n<pre><code>[$comment convert]\n<\/code><\/pre>\n\n<!--section=installation-->\n<ol>\n<li>Upload <strong><code>shortcode-directives.php<\/code><\/strong> and other files compressed in the zip folder to the <strong><code>\/wp-content\/plugins\/<\/code><\/strong> directory.<\/li>\n<li>Activate the plugin through the 'Plugins' menu in WordPress.<\/li>\n<li>Go to <strong>Dashboard<\/strong> -&gt; <strong>Tools<\/strong> -&gt; <strong>Shortcode Directives<\/strong>.<\/li>\n<li>Configure the options by enabling post types to support.<\/li>\n<\/ol>\n\n<!--section=changelog-->\n<h4>1.0.0<\/h4>\n\n<ul>\n<li>Released.<\/li>\n<\/ul>","raw_excerpt":"Allows you to perform certain actions on posts and comments with shortcode directives.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/115851","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=115851"}],"author":[{"embeddable":true,"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/miunosoft"}],"wp:attachment":[{"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=115851"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=115851"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=115851"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=115851"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=115851"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=115851"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}