{"id":15526851,"url":"https://github.com/michaeluno/shortcode-directives","last_synced_at":"2026-05-04T03:33:39.010Z","repository":{"id":152019290,"uuid":"230749032","full_name":"michaeluno/shortcode-directives","owner":"michaeluno","description":"A WordPress plugin that enables directive shortcodes which perform certain tasks against posts and comments.","archived":false,"fork":false,"pushed_at":"2020-01-09T06:06:07.000Z","size":684,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-03T06:39:17.115Z","etag":null,"topics":["command","commands","comments","directive","directives","plugin","posts","shortcode","shortcode-directive","shortcode-directives","shortcodes","wordpress","wordpress-plugin"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/michaeluno.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-12-29T12:44:51.000Z","updated_at":"2020-01-10T12:12:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"718a1b33-1078-4aed-9059-e45fe51b9137","html_url":"https://github.com/michaeluno/shortcode-directives","commit_stats":{"total_commits":11,"total_committers":1,"mean_commits":11.0,"dds":0.0,"last_synced_commit":"212b9b5093ac1f92359cdd7d16364f1d901b2edd"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaeluno%2Fshortcode-directives","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaeluno%2Fshortcode-directives/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaeluno%2Fshortcode-directives/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaeluno%2Fshortcode-directives/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/michaeluno","download_url":"https://codeload.github.com/michaeluno/shortcode-directives/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246100550,"owners_count":20723478,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["command","commands","comments","directive","directives","plugin","posts","shortcode","shortcode-directive","shortcode-directives","shortcodes","wordpress","wordpress-plugin"],"created_at":"2024-10-02T11:02:16.831Z","updated_at":"2026-05-04T03:33:33.977Z","avatar_url":"https://github.com/michaeluno.png","language":"PHP","funding_links":["https://www.paypal.com/en_US/i/btn/x-click-but04.gif"],"categories":[],"sub_categories":[],"readme":"# [Shortcode Directives](http://wordpress.org/plugins/shortcode-directives/)\n\n### Welcome to our GitHub Repository\n\nShortcode Directives is an open source WordPress plugin that allows you to perform certain actions on posts and comments with shortcode directives.\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"\" alt=\"Shortcode Directives\" /\u003e\n\u003c/p\u003e\n\n## Screenshots\n\n\u003cdiv style=\"margin:20px; float:left\"\u003e\n\t\u003ca href=\"\" title=\"Shortcode Directives - Settings\"\u003e\n\t\t\u003cimg src=\"\" alt=\"Shortcode Directives - Settings\" width=\"320\" /\u003e\n\t\u003c/a\u003e\n\t\u0026nbsp;\n\u003c/div\u003e\n\n## Installation\n\n- The latest development version can be found [here](https://github.com/michaeluno/shortcode-directives/branches). \n- The latest stable version can be downloaded [here](http://downloads.wordpress.org/plugin/shortcode-directives.latest-stable.zip).\n\n1. Upload **`shortcode-directives.php`** and other files compressed in the zip folder to the **`/wp-content/plugins/`** directory.,\n2. Activate the plugin through the `Plugins` menu in WordPress.\n3. Go to **Dashboard** -\u003e **Tools** -\u003e **Shortcode Directives**.\n4. Configure the options by checking post types to support the shortcode directives.\n5. Submit comments with the shortcode directives to perform certain operations against the selected posts/comments from front-end. \n\n\n## Usage\n\n### $post_status\nSets a specified post status.\n\n#### Format\n```\n[$post_status {status}]\n```\n\n#### Examples\nChanges the post status to `pending`.\n```\n[$post_status pending]\n```\n\nChanges the post status to `draft`.\n```\n[$post_status draft]\n```\n\n#### Option: --to\nSpecifies which post to apply the directive operation. This `--to` option is avialble for all the directives except `$comment`. Use `children`, `siblings`, and `descendants` 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, `self`.\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 `hierarchical` option.\n- `siblings`: the sibling posts of the subject post in hierarchical relationships if the post type supports the `hierarchical` option.\n- `decendants`: all the decendants which belong to the subject post if the post type supports the `hierarchical` option.\n\nThis moves all the descendant posts to trash.\n```\n[$post_status trash --to=descendants]\n```\n\n### $post_parent\nSets a post parent ID.\n\n#### Format\n```\n[$post_parent {post ID}]\n```\nSets a post parent of a post ID of 1451.\n```\n[$post_parent 1451]\n```\nThis removes a post parent.\n```\n[$post_parent 0]\n```\n\n#### Option: --to\nThe same option values are supported described in the `$post_status` section above.\n\n### $post_column\nSets a value with a specified post column name to an existent post column.\n\n#### Format\n```\n[$post_column --column={colum name} {value}]\n[$post_column --column={colum name} --value=\"some value\"]\n```\n\nSetting the value `3` to the `menu_order` column.\n```\n[$post_column column=menu_order 3]\n```\n\nWhen a value must have a white space, use the `--value` option.\n```\n[$post_column --column=post_title --value=\"This is a title\"]\n```\n\n#### Option: --to\nThe same option values are supported described in the `$post_status` section above.\n\n### $post_meta\nSets a post meta value.\n#### Format\n```\n[$post_meta {key} {value}]\n[$post_meta {key1}=\"{some value1}\" {key2}=\"{some value2}\" {key3}=\"{some value3}\"...]\n```\n\nThis sets the post meta value `bar` to the `_foo` meta key.\n```\n[$post_meta _foo bar]\n```\n\nFor values containing white-spaces and multiple key-value pairs, use the attribute style format.\n```\n[$post_meta _question=\"Why did the chicken cross the road?\" _answer=\"To get to the other side\"]\n```\n\nTo delete meta keys, use the `--action` option by passing `delete`. This deletes the `_question` and `_answer` meta keys and their values from the database.\n```\n[$post_meta _question _answer --action=\"delete\"]\n```\n\nNote: the `--to` and `--action` option names are reserved by the plugin so you cannot specify them with the option name like `[$post_meta --action=\"my value\" --to=\"another value\"]`.\n\nIf you have to set them, use the command-line style format introduced above.\n```\n[$post_meta --action \"Some value here.\"]\n[$post_meta --to \"Another value here.\"]\n```\n\n#### Option: --to\nThe same option values are supported described in the `$post_status` section above.\n\n### $taxonomy\nSets taxonomy terms with a specified taxonomy slug.\n\n#### Format\n```\n[$taxonomy --slug={taxonomy slug} {term1} {term2} {term3}...]\n```\n\nThis adds the `Apple`, `Banana`, `Apple Pie` terms of the `post_tag` taxonomy to the post.\n```\n[$taxonomy --slug=post_tag Apple Banana \"Apple Pie\"]\n```\n\n#### Option: --action\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\n\nThis removes the `Apple`, `Banana`, `Apple Pie` terms of the `post_tag` taxonomy from the post.\n```\n[$taxonomy --slug=post_tag Apple Banana \"Apple Pie\" --action=remove]\n```\nThis deletes the `Apple`, `Banana`, `Apple Pie` terms of the `post_tag` taxonomy from the database if they are assigned to the post.\n```\n[$taxonomy --slug=post_tag Apple Banana \"Apple Pie\" --action=delete]\n```\nThis removes all the assigned terms of the `post_tag` taxonomy from the post.\n```\n[$taxonomy --slug=post_tag --action=remove_all]\n```\nThis deletes all the assigned terms of the `post_tag` taxonomy from the database.\n```\n[$taxonomy --slug=post_tag --action=delete_all]\n```\n\n#### Option: --to\nThe same option values are supported described in the `$post_status` section above.\n\n### $tag\nSets non-hierarchical taxonomy terms.\n\n#### Format\n\n```\n[$tag {tag1} {tag2} {tag3}...]\n```\n\nWhen the `$tag` 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 `$taxonomy` directive. See the `$taxonomy` section above.\n\nThis adds the `Apple`, `Banana`, `Apple Pie` tags to the post.\n```\n[$tag Apple Banana \"Apple Pie\"]\n```\n\n#### Option: --action\nThe same action values with the `$taxonomy` directive are supported.\n\nThis removes the `Apple`, `Banana`, `Apple Pie` tags from the post.\n```\n[$tag --action=remove Apple Banana \"Apple Pie\"]\n```\nThis deletes the `Apple`, `Banana`, `Apple Pie` terms from the database if they are assigned to the post.\n```\n[$tag --action=delete Apple Banana \"Apple Pie\"]\n```\nThis removes all the tags associated with the post.\n```\n[$tag --action=remove_all]\n```\nThis deletes all the tags associated with the post from the database.\n```\n[$tag --action=delete_all]\n```\n\n#### Option: --to\nThe same option values are supported described in the `$post_status` section above.\n\n### $category\nSets hierarchical taxonomy terms.\n\n#### Format\n```\n[$category {category1} {category2} {category3}...]\n```\nWhen the `$category` 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 `$taxonomy` directive. See the `$taxonomy` section above.\n\nThis adds the `Apple`, `Banana`, `Apple Pie` categories to the post.\n```\n[$category Apple Banana \"Apple Pie\"]\n```\nThis removes the `Apple`, `Banana`, `Apple Pie` categories from the post.\n```\n[$category Apple Banana \"Apple Pie\" --action=remove]\n```\nThis deletes the `Apple`, `Banana`, `Apple Pie` categories from the database if they are assigned to the post.\n```\n[$category --action=delete Apple Banana \"Apple Pie\"]\n```\nThis removes all the categories associated with the post.\n```\n[$category --action=remove_all]\n```\nThis deletes all the categories associated with the post from the database.\n```\n[$category --action=delete_all]\n```\n\n#### Option: --action\nThe same action values with the `$taxonomy` directive are supported.\n\n#### Option: --to\nThe same option values are supported described in the `$post_status` section above.\n\n### $comment\nPerforms certain actions againt a replying comment. If commented on a post, the action applied to _all_ the comments which belong to the post. So be careful not to do that when you want to do someting on a single comment.\n\n#### Format\n```\n[$comment {sub-command}]\n```\n\n#### Sub-commands\n- `delete` / `remove`: deletes the comment\n- `hold` / `disapprove`: changes the comment status to `hold`.\n- `trash`: moves the comment to trash\n- `spam`: mark the commet as spam\n- `convert`: converts the comment to a child post.\n\nReplying to an existent comment with the following deletes the comment.\n```\n[$comment delete]\n```\n\nFor hierarchical post types, the `convert` sub-command can help bulk-convert comments in to posts.\n\nCommenting on a _post_ (not an existent comment) converts all the comments belonging to the post into posts by keeping the hirarchical relationships.\n```\n[$comment convert]\n```\n\n## Bugs ##\nIf you find an issue, let us know [here](https://github.com/michaeluno/shortcode-directives/issues)!\n\n## Support ##\nThis is a developer's portal for Shortcode Directives and should _not_ be used for support. Please visit the [support forums](http://wordpress.org/support/plugin/shortcode-directives).\n\n## Contributions ##\nAnyone is welcome to contribute to Shortcode Directives.\n\nThere are various ways you can contribute:\n\n1. Raise an [Issue](https://github.com/michaeluno/shortcode-directives/issues) on GitHub.\n2. Send us a Pull Request with your bug fixes and/or new features.\n3. Provide feedback and suggestions on [enhancements](https://github.com/michaeluno/shortcode-directives/issues?direction=desc\u0026labels=Enhancement\u0026page=1\u0026sort=created\u0026state=open).\n\n## Supporting Future Development ##\n\nIf you like it, please rate and review it in the [WordPress Plugin Directory](http://wordpress.org/support/view/plugin-reviews/shortcode-directives?filter=5). Also donation would be greatly appreciated. Thank you!\n\n[![Donate with PayPal](https://www.paypal.com/en_US/i/btn/x-click-but04.gif)](http://en.michaeluno.jpdonate) \n\n## Copyright and License ##\n\n### Shortcode Directives ###\nReleased under the [GPL v2](./LICENSE.txt) or later.\nCopyright © 2015 Michael Uno\n\nThis program is free software; you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation; either version 2 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License along\nwith this program; if not, write to the Free Software Foundation, Inc.,\n51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaeluno%2Fshortcode-directives","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmichaeluno%2Fshortcode-directives","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaeluno%2Fshortcode-directives/lists"}