I would create custom post meta for this data, as it seems the most logical. It should be easy to implement, since you don’t need to expose this custom meta data to the UI; just add a callback to save_post
.
You can use wp_get_theme()
to retrieve information about the current Theme. This function returns an instance of the WP_Theme
object.
function wpse76752_add_post_meta() {
global $post;
$current_theme = wp_get_theme();
update_post_meta( $post->ID, '_current_theme', $current_theme->Name );
}
add_action( 'save_post', 'wpse76752_add_post_meta' );
Note that I prefaced the custom post meta key with an underscore. This prevents the meta key from being listed in the “custom fields” dropdown in the Edit Post screen. (Basically, it makes it an “internal” post meta key, that is hidden from the UI unless you explicitly expose it.)
Related Posts:
- Is There a Difference Between Taxonomies and Categories?
- Control term order on a per-post basis
- Send an email when custom post type category is changed
- Are Categories, Tags and Custom Taxonomies any different in regards to SEO?
- Action hooks returning old category instead of new category
- Is There a Difference Between Taxonomies and Categories?
- How to store category and tags separatly on wordpress?
- Categories and Tags Conflict after Woocommerce Installation
- Getting Post Tags From Certain Categories
- What is the difference between a “tag” and a “category”?
- Check if a post is in any child category of a parent category
- How to export and import taxonomies (category, tag and/or custom taxonomy) and their terms
- Can’t custom taxonomies have same terms (slugs) as categories?
- How to display non-hierarchical taxonomy as terms with checkboxes?
- get_terms vs. get_categories: does it matter?
- Woocommerce get category image full size
- Order get_terms() By Custom Field
- How do the ‘tag’ and ‘category’ (default) taxonomies do ‘save_post’ action?
- get all tags from category
- 404 Error On Category and Tags Pages
- Fixing category count
- Checklist of selected categories
- How can I get category ID by category name?
- Rewrite URL with category and tag combined using WP_Rewrite
- get_terms name__like list categories according to letter
- How to tax query X number of posts related by tag first, then by category if not enough in tag-related
- Use tag interface for hierarchical taxonomy?
- Elegant way to add parent categories?
- How can I select a primary category?
- Sort posts by tags in category pages
- How to search for categories and/or tags?
- Using URL parameters, list posts from category and custom taxonomy
- Programmatically create product category and add thumbnail in woocommerce
- How to get the url to tag & category base set by the user?
- How to order the get_categories result
- Filter categories using tags
- Sticky posts on home page, search, tag and archives without plugin
- Category and tag with same name
- Create subdomains for tags and categories
- In the tag archive – display count of posts for each category they belong to
- Is it possible to disable certain user roles from creating tags?
- Automated adding of one tag to all the posts in a category
- Excluding posts from a category but only if they’re not in multiple categories
- Moving Categories submenu to Media, but still opens Posts menu
- what is the action hook code to supporting product category condition in single product page of woocommerce?
- Update term count using a callback function
- Get terms that are associated with products from current category
- Exclude most recent posts from specific category in wp_query()
- When using get_categories or similar, is it possible to filter results that contain certain Tags as well?
- How to totally get rid of Category in my blog?
- Root level category, tag, author and archive pages to work
- Prevent function from triggering again when post in specific category gets another category?
- Showing all the posts in one page?
- Does WordPress Offer a Way to Find All of the Categories that Don’t Have Children?
- Categories and Tags returning 404 on the sidebar when using ugly permalinks
- Add custom taxonomy terms to WordPress menu dynamically & append #slug to url
- Removed slug from CPT, now How/where do I hook the filter to the taxonomy term archive pages link?
- Getting the sub category
- Use get_term_children to get the sub category of a parent category for the current post
- Deleting All tags except categories Wp database
- Is it possible to put tags and category information in the post as text?
- Update wordpress post terms programatically
- Script to duplicate categories as tags
- Display empty taxonomy terms with get_terms()
- Search by word, category, tag, author
- Get a list of Terms for a specific category
- Remove Categories and Tags from Admin Dashboard
- How to filter archives both by category and tag?
- Remove Archive Headline and Archive Intro Text fields on category and tag archive pages in WordPress Admin with Genesis framework
- display most popular tags of category?
- Get tags specific category
- Can paginate_links() be customized for a specific category or tag?
- When to use ‘get_category_by_path’ vs. ‘get_term_by’ to get category object from `get_query_var( ‘category_name’ )`?
- Any way to assign Post Categories and Tags to Links?
- Category archive page – loop through posts of certain tag (with pagination) – pre_get_posts
- Category vs Tag vs Table
- Help with multiple dropdown tags search
- Custom WP_Query for current category (in category.php)?
- Hide tag and category boxes from the post editor
- Retrieve all posts within tag OR category?
- How to find the number of Tags a post has?
- How to not treat categories as tags in feeds
- How to add custom script to the particular Product Category page
- How to remove the “+Add Category” button from the Category metabox?
- Hide posts of a certain category unless logged in
- Categories: A Greenhorn Question on Strategy (Not Code)
- How to customize tag and category post listings to show introductory content?
- Add title, post content, and category like add_post_meta and update_post_meta
- List Terms in Category
- How do I get a list of all categories that a given user has written blog posts for?
- Are Category or Tag Archive Pages Possible?
- Set post categories to include parents when setting child category
- Warning: sizeof (): Parameter must be an array or an object that implements Countable, On products pages
- How to get data about category in category.php
- How can I duplicate categories and tags?
- How to run select query of post with category and tags for API?
- Making a tourism information website [closed]
- Random post + categories + tags
- Limit number of terms that a custom taxonomy can save per custom post type
- Search Posts / Pages with multiple options?