I just ran a quick test on a site that uses custom taxonomies. The sample code that you used works for me.
I did the following
$test_term_by = get_term_by('name', 'Sample Name', 'my-custom-taxonomy');
// note that this produces a "stdclass object", not an array.
echo '<pre>';
print_r($test_term_by);
echo '</pre>';
echo $test_term_by->term_taxonomy_id; // one of the values of our object.
Perhaps you want to do some testing with the get_term_link( $term, $taxonomy )
function, which is a bit more straightforward in it’s output, and can be useful for your debugging.
Related Posts:
- Remove Custom Taxonomy Metabox from Custom Post Type Screen
- Get terms by taxonomy AND post_type
- Permalink Structure for Multiple Post Type Archives by Taxonomy
- Get Custom Taxonomy ID within loop
- Custom Post Types not showing on Custom Taxonomy archive page
- custom post type or taxonomy
- Remove Trash / Delete option for Custom Post Type / Taxonomy
- How to filter custom post types by custom category taxonomy
- Highlight menu item when on a custom post type?
- Changing the priority of a custom taxonomy’s metabox
- How to setup a Custom Taxonomy Term template
- Admin to user notices – best practices?
- How to select one major category (or custom taxonomy) for a custom post type?
- Custom taxonomy & post slug permalink
- Retrieve a specific field from taxonomy term through advanced custom fields [closed]
- Custom Taxonomy List links being re-written
- front end radio custom taxonomy with custom post type
- Child and grandchild taxonomy listings – 404
- Limit taxonomy results to a single cpt
- Bulk 301 redirect for custom post type
- Associate Taxonomies Across Post Types
- ‘category__and’ for custom taxonomy?
- Custom post query by taxonomy
- Custom Permalink with Dynamic Taxonomy for Custom Post Type – Works, but breaks other permalinks
- How can I show recent posts from same taxonomy as the post currently being viewed?
- Relationship between two taxonomies and a custom post type [closed]
- Sharing a custom taxonomy with Multiple custom post types
- next_post_link on custom taxonomy
- Show Two custom Post type and their posts on category page
- Group custom posts by custom taxonomy names
- Change Permalink Structure for Tag.php template
- How to query custom post types posts filtered by multiple custom taxonomies through a form selection
- Get post from custom post type order by two taxonomies
- How to convert custom post type based list to a dropdown list?
- Wrong request query on cpt and tax
- Custom Taxonomy Archives on Custom Post type Page [duplicate]
- How can I make the slug of the taxonomy also the slug of the custom post
- Listing posts under primary and secondary taxonomies
- How to list custom taxonomies in the back end
- How do I display the grand child items of a taxonomy term?
- Is it better to use WordPress Custom Post Types or Taxonomies?
- Top Level pages in wordpress giving 404, but child pages working fine
- Search by tag name and category
- Listing custom terms in custom post meta
- Query posts with double taxonomy
- get_the_title() is returning results from previous loop
- How do I display a list showing custom post types nested within a taxonomy?
- Display posts with tag for custom post type only
- Creating two loops based on different logic
- get_category_link() for custom post type does not include custom slug rewrite?
- How to show all taxonomies within custom post type loop
- Showing taxonomy terms on custom post type
- Custom Search | check multiple meta_value for search value
- get_terms() returns Trying to get property of non-object error for custom taxonomy
- How to list custom post types on a custom post type page?
- How to create a template to show child terms of a MAIN taxonomy
- Using WP_Query, I want to show posts that are associated with a custom taxonomy term
- How do I add new post formats to twenty fourteen theme?
- Foreach loop returning more than one item when querying taxonomy
- Display next 3 posts based on custom taxonomy
- Check when the post type changes, and display content
- Loop and add Specific Categories and Products Images
- custom post archive URL is wrong
- custom post type or taxonomy, which approach is better?
- Display latest post of taxonomy
- Custom Post Type with Different Sets of Post Content?
- Add a class to a div if custom post type has specific terms?
- Custom post type paging return home page
- In child theme, add CPT to custom taxonomy registered in parent theme
- Custom taxonomies not displaying in some custom posts
- Custom taxonomy returns 404 even with saving permalinks
- Static Front Page not working for custom theme
- WP_Query to display number of custom post type filtered (order by) taxonomy
- Custom post type shortcode with taxonomy attribute not working and no errors
- Live search by custom tag
- Set a Default CPT taxonomy by taxonomy id
- Custom taxonomy terms registered not showing when added in child theme
- Redirect Custom Post Type from Child Taxonomies
- Custom post edit page permalink links to edit page rather than the post
- Not Able to List CPT Based on Taxonomy Term
- Show tags of custom post types in WordPress
- Filter Term By Parent Term – Custom Post Type
- Display all Custom taxonomy terms and their relevant custom posts
- WordPress get all post with like in terms [duplicate]
- Best way to group posts based on custom post type terms
- Query Pulling the same post twice
- Render custom taxonomy query as single template
- Custom meta-box for all custom post types
- Loop multiple taxonomy in custom post
- Display and Allow users to edit their own profiles
- Remove custom taxonomy ‘post-type’ from post URL
- Building a List of Posts grouped by custom taxonomy as the section header only to be displayed if at least one post is in that tax
- Custom My account page and custom page for editing posts
- Listing all custom post types using a specific term on the said term’s template page, in groups
- Require Custom Taxonomy for Custom Type
- 404 Error On Custom Taxonomy Pages 2, 3, etc
- Get all active posts that are tied to a custom taxonomy for a custom post type
- Filtering custom post types using category taxonomy
- How to use wp_set_object_terms depending on page ID?
- Permalinks for Custom Post Types and Taxonomies