Skip to content

WordPress plugin (for DMG) to add a Gutenberg post search block and wp-cli command

License

Notifications You must be signed in to change notification settings

baberparweez/dmg-read-more

Repository files navigation

DMG Read More WordPress Plugin

WordPress Gutenberg block plugin with two different features:

  1. 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.
  2. 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.yml that 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
    • 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 --txt to create post_ids_<n>.txt batches (500 IDs each) under wp-content/uploads/dmg-read-more/post-ids-<timestamp>/.

NOTE

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.

About

WordPress plugin (for DMG) to add a Gutenberg post search block and wp-cli command

Resources

License

Stars

Watchers

Forks