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

Turn two blogs into features #20

Open
rachelrosenfelt opened this issue May 5, 2017 · 2 comments
Open

Turn two blogs into features #20

rachelrosenfelt opened this issue May 5, 2017 · 2 comments
Assignees

Comments

@rachelrosenfelt
Copy link

Hey Pea!
Two of our bloggers are ending their operations. The Beheld authored by Autumn Whitefield-Madrano and Austerity Kitchen authored by Christine Baumgarthuber. I don't want to lose the posts or let their blogs sit dormant, so I wondered if we could re-classify those blog posts as features and them remove them from the blogs page? Let me know if that's doable.

@misfist
Copy link
Collaborator

misfist commented May 5, 2017

Yes, it requires writing a SQL query. We'll need to:

find in wp_posts where post_type = 'blogs' and in wp_term_relationships where term_id = 43 or 44
update in wp_posts to post_type = 'post' and wp_term_relationships to term_id = 3047

@misfist misfist self-assigned this May 22, 2017
misfist added a commit that referenced this issue May 22, 2017
#20 Added utility function to switch post_type `tni_switch_post_type()`
misfist added a commit that referenced this issue May 22, 2017
@misfist
Copy link
Collaborator

misfist commented May 22, 2017

I added a utility function that can be used to change post types.

tni_switch_post_type( $old_post_type, $old_term = null, $old_taxonomy = null, $new_post_type, $new_term = null, $new_taxonomy = null )

Using WP-CLI, it can be executed from the command-line on the server.

wp eval 'tni_switch_post_type( "blogs", 1464, "blog-types", "post", 3049, "category" );'

I implemented on the staging server.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants