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
- Can’t custom taxonomies have same terms (slugs) as categories?
- How to display non-hierarchical taxonomy as terms with checkboxes?
- How can I get category ID by category name?
- get_terms name__like list categories according to letter
- Use tag interface for hierarchical taxonomy?
- How can I select a primary category?
- Using URL parameters, list posts from category and custom taxonomy
- How to get the url to tag & category base set by the user?
- Create subdomains for tags and categories
- Excluding posts from a category but only if they’re not in multiple categories
- How to totally get rid of Category in my blog?
- Root level category, tag, author and archive pages to work
- Showing all the posts in one page?
- Categories and Tags returning 404 on the sidebar when using ugly permalinks
- Add custom taxonomy terms to WordPress menu dynamically & append #slug to url
- Getting the sub category
- Use get_term_children to get the sub category of a parent category for the current post
- Is it possible to put tags and category information in the post as text?
- Script to duplicate categories as tags
- Get a list of Terms for a specific category
- 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?
- 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?
- How to add custom script to the particular Product Category page
- How do I get a list of all categories that a given user has written blog posts for?
- How can I duplicate categories and tags?
- How to run select query of post with category and tags for API?
- Limit number of terms that a custom taxonomy can save per custom post type
- How can i insert term in a specific language of Polylang?
- How to display categories which contains particular tag?
- “Categories” for six authors [closed]
- How to “group” (categorize) the Pages together?
- Custom SQL Query: Get all posts with category id and a concated list of tags on each post
- get_terms function not returning anything
- Display custom taxonomy attached to the post on post single page
- Related Tags not in category
- Ive got a term (get_term_by) but now I want to filter it by a category it is in?
- Get a count of how many times a term or a category is used in posts
- scaleability of tags
- Get Categories Where Taxonomy Equals ‘n’
- How do I add a tag slug to a category URL to filter posts?
- Show the amount of posts in a tag in a specific category has
- The Difference Between Categories and Tags and Taxonomies and Terms
- How to access deleted term inside delete_product_cat action
- Adding a H1 Tag to Post Tags automatically, but hide the tag? (Same for Category)
- Getting Category Children
- Conditional category & tag statement
- Include either name or slug in the include parameter using wp_list_categories?
- List all posts of certain category which share some tags
- How can I filter posts by tag on the fly
- Retrieve post tags from from main wp_query
- Advanced permalinks structure
- Custom menu with categories and tags
- display specific category when website loads
- Automatically adding tags and categories into Post Excerpt for searching
- List taxonomy terms assigned to a post in hierarchical view
- Return all Tags and Categories in Separate List
- How to filter tags by category?
- How to get immediate children of a ‘term’ parent id through ‘get_terms’?
- Ordering terms whilst in loop
- get taxonomies from terms
- Count how many posts have a specified tag AND category
- How to prevent tag “iframe” from being deleted from the heading description of rubric?
- Get WooCommerce product category list in functions.php
- Get_term_meta() does not work with pre_get_posts()
- List non-empty categories from a custom post type
- When creating category, it creates automatically tag, or, when creating tag, it creates automatically category in same name
- Using heirarchial tags or Custom taxonomies
- Balance Tags to the_content Words Length
- How to echo Tags and Categories as plain text
- Get category of a taxonomy for a queries object in a loop
- How can I add metaboxs to Admin Bar?
- get_terms sort order with child categories of varying depth
- Exclude posts with certain tags in category archive
- Display List of Categories Within a Custom Taxonomy
- How to remove specific categories from tag archives?
- Page Type with Category Link
- A simple question regarding tags and categories
- How to add a new child category via an SQL statement?
- How can I allow people to ‘subscribe’ to categories?
- How to add an empty entry to masonry?
- Own Custom Tags/Category page ( posts)
- Loops in category description
- Why is my post categories not displaying?
- Tracking multiple tags or categories
- How to load jquery tag-it plugin into admin?
- Problem importing categories and sub-categories
- Query posts that have all the specified tags
- Moving Blog and Changing URL