I think you should use json_encode in the page that you would like to run. Here is some ideas how you to solves.
add_action('admin_init', 'my_taxonomy_list');
function my_taxonomy_list() {
if (specific_page) { //check not to run in other pages
$taxonomies = get_taxonomies();
foreach ( $taxonomies as $taxonomy ) {
$tax_list[] = $taxonomy->slug;
}
?>
<script>
var tax_list = <?php echo json_encode( $tax_list ) ?>;
</script>
<?php
}
}
And then you could access tax_list to be able to use in javascript file.
Related Posts:
- Show all terms of a custom taxonomy?
- How to Add Custom Fields to Custom Taxonomies in WordPress CLEANLY
- Creating custom Woocommerce attribute taxonomies from a plugin
- How to paginate a list of custom taxonomy terms?
- Get used terms by an author as array of strings
- How to get the term before the last from a custom taxonomy?
- How to create filterable portfolio in WordPress?
- Best way to create a user programatically
- Javascript code inside “” in core WordPress files .php
- Display Post co-authored in Author Page
- Include a specific post to the query_posts and remove it if it is already in the returned list
- Add attribute / custom attribute to product in woocommerce
- How to add custom taxonomy slug in CPT permalink?
- Show Custom Taxonomy Title
- conditional statement for custom taxonomy
- Loading jQuery in the footer after removing jQuery migrate?
- Writing scripts using WordPress / WooCommerce classes?
- get_terms orderby numeric
- Rename “Portfolio” slug?
- Sum custom field values of particular taxonomy
- Insert a button on a page with random number generation
- Query all posts of a custom taxonomy term
- get_term_link() returns incorrect url
- Create a hierarchical taxonomy list in WordPress
- Randomly Assign an Image’s Alt Text Based on Data From Post
- Can I prevent the user from adding more than two levels deep of terms inside of a taxonomy metabox?
- Why my filterable portfolio page work not perfectly between slug button and slug output WORDRPESS?
- How to get original custom taxonomy slug after the slug has been rewritten?
- Displaying custom taxonomy on WooCommerce product page
- How to split links generated into an xml sitemap to avoid exceeding 30 sec maximum execution time?
- multiple taxonomy select display only one in front end
- Display parent and child taxonomies in separate drop down select fields
- How to show only subcategories in parent category not parent category?
- need help with existing code showing subpages
- php syntax : [ && ] between commands [closed]
- Pull Tags But Not as Links
- Need to put a script above tag in header.php – WP 5.7.1
- Copy taxonomy terms from one post to another programmatically
- working with term_relationships table
- How to filter custom taxonomy term name, slug, and description?
- Ajax filter button display all posts
- Hierarchical taxonomy list with modificated term links
- Use get() method to grab all categories and output inside another method
- Listing titles and custom fields of entries within subcategories
- fetch woocommerce product with custom taxonomy
- How can I get my Media Uploader Button to function on 1 click rather than requiring 2 clicks?
- Create a a form for custom taxonomy terms
- Storing content into a custom taxonomy
- Check in which custom taxonomy belongs and change the style
- WordPress custom taxonomy
- making php value numeric
- Taxonomy term description with style, only if the description exists?
- PHP displaying wrong custom taxonomy images
- WordPress: Displaying all the post tags from within a specific taxonomy’s term
- how to insert content into my taxonomy
- How to change the author box selection on a post to a custom taxonomy
- WordPress: Export/Import Yoast meta title & description to custom taxonomy
- WP_Query – How to query all of post types categories
- Show related products by attribute based and certain conditions
- Display acf taxonomy attachment
- How to hide a child category and show his parent category
- How to update posts’ custom taxonomy selection?
- How to retrieve taxonomy Metabox fields in frontend
- WP custom posts: filter results to custom taxonomy tag that corresponds to user meta field
- ACF Taxonomy field values not select in backend
- Categories does not show Block editor WordPress
- ACF – Can’t get custom post type by taxonomy
- custom taxonomies not working
- Filtering custom posts by using checkboxes for taxonomy in an ajax loop always gives server 500 error
- How do I add this OnClick event script to a custom button I’ve created?
- How to separate the taxonomies list from the form so that editing taxonmies is the same as pages and posts?
- WordPress search query, how to modify the sql
- How to insert text into post based on category – via single.php file
- Get Posts by Custom Taxonomy on Custom Post
- how to call other plugins once custom post has been inserted
- style.min.css code issue
- str_replace not preserving whitespace
- How to replace hard-coded list of custom taxonomy terms based on custom field query [closed]
- Editing existing pre-created menus in PHP
- enumerating custom taxonomies?
- how to display child terms with parent terms in custom taxonomy?
- Custom Taxonomy Link Text Echo Name Not Slug
- Custom Taxonomy as Link
- WordPress Rewrite Issue
- Limit Taxonomy Parents
- Page 2+ of taxonomy archives does not recognise sort-order from dropdown
- Get category id for a custom category and display it in a class
- Saving category as insert post
- How to show all of aspecific post type that has taxonomy and a specific term
- Pass custom value to custom taxonomy
- Auto create description in post
- How do I change the Go To Categories link in the term_updated_messages
- Display terms on product page with shotrcode
- Query posts by custom taxonomy slug in WP REST API?
- WordPress different custom tag being displayed in on tag list
- Get category name of current post (CPT UI)
- Three different queries on same page
- I want to show image from custom field image on my custom page template
- How to make multiple custom taxonomies sit under custom post type slug?
- Running a long script in PHP