Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support --all for wp embed cache clear #67

Open
1 task done
stefanfisk opened this issue Aug 23, 2022 · 1 comment · May be fixed by #74
Open
1 task done

Support --all for wp embed cache clear #67

stefanfisk opened this issue Aug 23, 2022 · 1 comment · May be fixed by #74

Comments

@stefanfisk
Copy link

Feature Request

Describe your use case and the problem you are facing

There's currently no way of completely clearing the oembed cache. This is for example useful after one has added a oembed_dataparse filter to modify the HTML.

Describe the solution you'd like

I'd propose adding an cache clear-all command.

The quick and dirty version is to run DELETE FROM wp_posts WHERE post_type = 'oembed_cache' and DELETE FROM wp_postmeta WHERE meta_key LIKE '_oembed_%'.

@danielbachhuber
Copy link
Member

@stefanfisk The use-case seems reasonable to me!

The feature itself might be better implemented by changing wp embed cache clear <post_id> to wp embed cache clear [<post_id>...] [--all].

With this change, the command should error if neither post IDs nor --all are provided.

Want to submit a pull request with Behat feature tests?

@danielbachhuber danielbachhuber changed the title Add clear-all command Support --all for wp embed cache clear Aug 25, 2022
nlemoine added a commit to nlemoine/embed-command that referenced this issue Sep 1, 2023
- Removes posts (`oembed_cache`), post metas (`_oembed_{hash}`, `_oembed_time_{hash}`), transients (`_transient_oembed_{hash}`, `_transient_oembed_time_{hash}`) caches
- Add tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants