Reputation: 11
Is it possible to add extra columns in WordPress Posts table and then use select query?
How will the select query be?
Upvotes: 0
Views: 382
Reputation: 183
I would recommend wp post meta. See the links below.
https://developer.wordpress.org/cli/commands/post/meta/ https://codex.wordpress.org/Class_Reference/WP_Meta_Query
# Set post meta
$ wp post meta set 123 _wp_page_template about.php
Success: Updated custom field '_wp_page_template'.
# Get post meta
$ wp post meta get 123 _wp_page_template
about.php
# Update post meta
$ wp post meta update 123 _wp_page_template contact.php
Success: Updated custom field '_wp_page_template'.
# Delete post meta
$ wp post meta delete 123 _wp_page_template
Success: Deleted custom field.
Regards. Ed.
Upvotes: 2