WordPress Gutenberg block plugin with two different features:
-
Search for and then choose a published post to insert into the editor as a stylised anchor link
- Search for 'DMG Read More' in the Gutenberg editor and add it to the required area.
-
WP-CLI command to execute a WP_Query search for Posts (within a date range) that contain this Gutenberg block
- Make sure the CMD is running WP-CLI.
- The plugin includes a
wp-cli.ymlthat points WP-CLI to the WordPress root, so you can run the command either from the site root or directly inside this plugin directory:- From the site root:
wp dmg-read-more search - From the plugin directory:
wp dmg-read-more search
- From the site root:
- Optional arguments:
- Posts published before a specific date:
--date-before=2024-04-09 - Posts published after a specific date:
--date-after=2024-04-05 - Posts published between specific dates:
--date-before=2024-04-09 --date-after=2023-08-24 - Write matched IDs to text files: add
--txtto createpost_ids_<n>.txtbatches (500 IDs each) underwp-content/uploads/dmg-read-more/post-ids-<timestamp>/.
- Posts published before a specific date:
There may be issues running the WP-CLI commands due to Local environment variables not being enabled by default. This is usually a Local by Flywheel issue. This forum explains how to run WP-CLI commands within Local by Flywheel.