Filter by post types and post status in post table
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 20/100
Direzione di ricerca
Start with the wp search-replace command and trace how it selects posts, revisions, and post types. Clarify the intended semantics of the proposed status and post-type options, then define completion as restricting replacements to the requested values without changing excluded content; no files or tests are named in the issue.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Feature Request
- Yes, I reviewed the contribution guidelines.
Describe your use case and the problem you are facing
I currently use search-replace for batch editing content (when the name of an event that we do has changed for example...)
There's been a couple instances where I would have preferred search-replace to only
edit the content that is currently published (post_status=published) not in past revisions; or only to only change in specified post_types (we updated the url structure for only one kind of custom post_type).
Describe the solution you'd like
I was wondering if it's possible to add an additional parameter to the search-replace command so that when search and replaces are made; the user can specify the
only affect the current revision of content in the wordpress database.
(Thinking aloud this could be done by filtering the post_status or post_type columns for specified values.
(I'd add an extra parameter like post_status=publish which would not update currently published content) using a parameter like --skip-post-status.
Example usage:
wp search-replace 'before' 'after' --skip-post-status=publish --recurse-objects --skip-columns=guid --skip-tables=wp_users
or to only edit certain post types like
--include-post-type-values=my_custom_post_type
Example usage:
wp search-replace 'before' 'after' --include-post-type-values=my_custom_post_type --recurse-objects --skip-columns=guid --skip-tables=wp_users
Filtering out the post_status and post_type columns for their values can be done using a SQL statement but adding this to wp-cli hopefully would be worth doing.
- Lingua principale
- Gherkin
- Stelle
- 61
- Fork
- 47
- Merge medio
- 8m
- PR unite (30g)
- 1
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di wp-cli/search-replace-command
-
bug command:search-replace scope:distribution state:unconfirmed
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
wp-cli/search-replace-command#231 · 5 commenti ·
-
command:search-replace
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
wp-cli/search-replace-command#194 · 1 commento ·
-
command:search-replace contributor-day
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
wp-cli/search-replace-command#186 · 2 commenti · 11 reazioni ·
-
command:search-replace
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
wp-cli/search-replace-command#142 · 5 commenti · 2 reazioni ·
-
command:search-replace
Difficoltà 3/5 1-2 giorni Idoneità per principianti 52/100
wp-cli/search-replace-command#137 · 6 commenti · 4 reazioni ·
Tutte le issue di wp-cli/search-replace-command
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
qgis/QGIS-Documentation#11275 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
milvus-io/birdwatcher#545 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
-
area:tools bug good first issue help wanted priority:P2
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
TaewoooPark/Motifcode#14 ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
newrelic-experimental/preflight#793 · 1 commento ·