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?
- How to get post’s current parent term ID?
- 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?
- 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
- How to filter custom taxonomy term name, slug, and description?
- Ajax filter button display all posts
- Hierarchical taxonomy list with modificated term links
- Exclude product attributes from taxonomy terms loop
- How to insert wp_users ->user login name to wp_terms when a new user registering?
- Listing titles and custom fields of entries within subcategories
- 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
- How to break up php code to avoid echo
- 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
- Hi need update in my terms for other 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
- Display acf taxonomy attachment
- How to hide a child category and show his parent category
- Get taxonomy terms that share a common object property
- How to update posts’ custom taxonomy selection?
- 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
- How to add a PHP scripts into WordPress
- 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
- 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
- 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
- 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
- Query specific posts per user selections from dropdown menus
- kali php problem [closed]
- How do I change the Go To Categories link in the term_updated_messages
- How can I change the URL via add_rewrite_rule()
- How do I organize posts based on their taxonomy?
- How to make multiple custom taxonomies sit under custom post type slug?
- Running a long script in PHP
- WordPress CPT & Custom Taxonomy with the SAME Permalink Structure
- translating a custom taxonomy term in a shortcode
- Remove slug and custom post type name from URL
- how can I get the selected term of a custom taxonomy
- Hot to show custom post type taxonomies on archive page