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?
- WP_Query | Help me create a search term with an ‘OR’ relation?
- Trigger a php file on every post or page if a condition is met
- 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
- WP_Query use for a filter with multiple Taxonomies and Terms
- 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_the_terms – only top level
- Get Custom URL For Custom Taxonomy
- 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?
- Grab posts by multiple categories
- How to get original custom taxonomy slug after the slug has been rewritten?
- Repeating admin-ajax.php not found error in admin
- 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?
- need help with existing code showing subpages
- Custom field values to taxonomy terms
- php syntax : [ && ] between commands [closed]
- Pull Tags But Not as Links
- Custom PHP script throws critical error ONLY when editing page
- Need to put a script above tag in header.php – WP 5.7.1
- Hardening uploads folder in IIS breaks images
- Copy taxonomy terms from one post to another programmatically
- working with term_relationships table
- 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
- Using Sprit-sheet on WordPress categories
- 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
- Manipulate database of WordPress site with my own scripts
- 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
- 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
- Display terms on product page with shotrcode
- Query posts by custom taxonomy slug in WP REST API?
- How can I change the URL via add_rewrite_rule()
- 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 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
- Same Custom Post Type Slug and Custom Taxonomy Slug, with hierarchial unique permalink structure
- 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
- Show the terms of the hierarchical taxonomy
- How to Bulk Update CPT Taxonomy Values Using CSV Lookup Table