You can detect if you are in the frontend using the function is_admin()
, like so:
add_filter('get_term', 'filter_term_name', 10, 2);
function filter_term_name($term, $taxonomy) {
// return the term untuched if you are in the admin
if( is_admin() ) {
return $term;
}
if ($taxonomy == 'my-taxonomy') {
// numeric value of term in another taxonomy
$meta_value = get_term_meta($term->term_id, '_my_meta_name', true);
if ($meta_value) {
// get name of meta value from another taxonomy
$value = get_term($meta_value, 'another-taxonomy');
if ($value) {
$term->name = sprintf('%s, %s', $value->name, $term->name);
}
}
}
return $term;
}
Related Posts:
- Adaptive product filters for WooCommerce
- Display post after choice two taxonomy terms
- is it possible to add “extra” table nav to edit-tags.php screens?
- Restrict filter to run only inside specific function
- How to always display a specific post from the search result first
- What hooks/filters are there to alter selected terms on post save?
- How to display term description in empty terms archive?
- Taxonomy Custom Column – ‘manage_{TAXONOMY}_custom_column’ filter only passing 2 arguments
- Is there a filter hook that I can use to change how taxonomy term names are displayed?
- How to order by taxonomy using wp_query
- Filter taxonomy admin pagination
- Insert term when page is published – avoid duplicates after edits
- Filter custom post type using multiple taxonomy dropdowns
- Create Search Form to Filter Through Terms
- Sorting a specific taxonomy by archive date using URL
- Create a pre-filtered version of the Media Library
- How to query if meta_key does exist or not?
- How to stop the deduction in “wp_term_taxonomy” count, when the post is deleted?
- Include get_term_link inside search
- List all categories that have results in a query
- Post filter with multiple checkbox taxonomy terms
- Admin view: filter posts by whether they have specific taxonomy attached
- WP Job Manager – display search results from custom search form in taxonomy-job_listing_category page
- Turn wp_tag_cloud into a front-end filter
- How to create a list of terms who’s posts also have a predefined external term?
- How to display custom taxonomy and terms using/creating plugin template
- Why is my post categories not displaying?
- Customize register form page with add_action or apply_filter
- filter on the_content stopped working when I updated to WP 3.6.1
- Replace Paid Shipping Method With Free Shipping Method WooCommerce [duplicate]
- get_the_excerpt on mobile still displays continue reading
- How to reset/remove added filters ‘posts_join’ and ‘posts_orderby’ after the loop is completed?
- Get all the contents of taxonomy and sort by term
- How to get all the terms of a post
- Wrapping Featured Image on Add/Edit Page in div?
- remove_filter excerpt_more from a plugin class
- Date filter for post query not filtering results when variable outside the function
- How do I remove certain HTML elements with specific classes from the feed?
- List a custom post type’s posts ordered by nested custom taxonomy
- Passing variable from filter
- Display yesterday’s last post’s Custom field from Unique terms of one Taxonomies
- How to turn this customized core function into a filter/action in functions.php?
- Exclude 2 in 3 terms of A Taxonomy from all Archives
- Delete Term via edit-tags.php
- Custom excerpt_more filter not working when tag is present
- Adding an orderby filter, casting postmeta with multiple keys
- Problem importing categories and sub-categories
- Author template – separate custom post type by custom taxonomy term for $curauth
- How we make the filter for fornt end user
- Filter image and text from post format
- Identify admin/logout and more filters
- Add Default WordPress Formatting To Data From External SQL Tables?
- Sanitizing a custom query’s clauses
- How can I display wp_link_pages before a shortcode, if it is used, or display after content?
- ISOTOPE – Missing/Invalid Arguement Get Terms
- Clean/filter HTML inserted to post content by XML RPC
- Filter and Search
- How to separate a specific page’s comments from other comments
- What is the scope and persistence of add_filter() and remove_filter()?
- how to localize the number of wordpress post views?
- Which hook should be used in this case?
- confusion with add_filter
- Echo used hierarchical taxonomies parent name
- add_filter with specific thumb names
- post->post_content filter
- Passing values by form to create a query
- Override typo in multiple parent theme files?
- Add HTML to Page Content
- Categorize posts on a page o the basis of category of other post on the same page
- How properly write function to filter content in a template for plugin “multiple content blocks”
- Filter dashboard custom post listing by user
- Taxonomy search filters
- Joining tables not working in the post editor page
- Order taxonomy terms by the frequency of use in the last 30 days
- get_the_term_list() wanting to loop through the returned values
- List custom taxonomy terms
- Is it possible to make get variable out of filter in Class?
- Getting the terms from “Beautiful Taxonomy Filters” Results ot Integrate into “Ajax Load More”
- Why can’t I exclude a term ID from either get_terms or WP_Term_query?
- Getting entry ID from frm_email_message filter in formidable
- Replace image scr with it’s surrounding href
- GET form action. Redirect to self
- Filter posts by multiple checkbox categories
- manage_users_custom_columns filter not firing callback functions
- ACF Load Field Groups Programmatically [closed]
- Conditionally including JS based on whether ACF field is set [closed]
- WooCommerce comments_template Filter Not Firing
- get_terms() – unexpected ‘=>’ (T_DOUBLE_ARROW) error
- Auto append text after the title?
- Remove pipe in views admin page filter
- Display associated taxonomy child name on single CPT page
- Woocommerce: Only one review per verified buyer [closed]
- Display woocommerce product_cat child terms with thumbnails
- Can One Taxonomies Terms be Ordered by A Seperate Taxonomy?
- After adding filter to plugin’s code, post’s content doesn’t display
- if i put the code in my theme’s function.php file can it work?
- Admin New Order: Autofocus on Search a product
- Is there a hook or filter that adds a button to the left of the search box?
- Why does using excerpt_more filter change link location?
- Issue On Listing Woocommerce Parent Tag List