Two words – variable scope. Use a closure instead and pass $rstax through with use:
add_filter(
'new_royalslider_posts_slider_query_args',
function ( $args ) use ( $rstax ) {
return array(
'post_type' => 'carousel-slide',
'orderby' => array(
'menu_order' => 'ASC'
),
'tax_query' => array(
array(
'taxonomy' => 'carousel-slide-category',
'field' => 'slug',
'terms' => $rstax,
),
),
)
}
);
Related Posts:
- How to customise the output of the WP image gallery shortcode from a plugin?
- Custom media upload content for inserting custom post shortcode
- Checking if an attribute exists in a shortcode
- All shortcodes not working on custom theme
- enqueue script only if it is not already enqueue
- Shortcode output appears before post body [duplicate]
- How to parse nested shortcodes?
- Loading shortcode with ajax
- How to call shortcode function directly and pass $atts
- change plugin shortcode function [closed]
- plugin shortcodes not working on custom theme- unsure how to fix
- Dynamic HTML not displaying at respective place
- Plugin form unable to process
- Nested shortcodes
- Should I global $wpdb outside of any of my plugin’s functions scope?
- Short code for Venues
- Frontend editing, Frontend user dashboard
- Can’t get custom posts of taxonomy to show
- Shortcode doesn’t work if I directly paste its function in a template file?
- Trying to count the total number of paragraphs inside a blog article
- How Can I Pass the Shortcode’s $atts Variable to the Plugin’s Javascript Function
- Pass variable to nested shortcode
- Add custom variable in Contact Form 7 mail body
- get shortcode value
- How to generate CSS from a shortcode within a plugin
- Storing Options in a Shortcode
- Prevent shortcode from being wrapped in tags
- How to remove html code in excel downloads using phpspreadsheet with wordpress plugins shortcode
- Override global query results without hooks
- Plugin Handle URL With Custom Theme
- How to put JQuery/Ajax inside shortcode?
- Snippets: is it better to add them in functions.php or make site-specific plugins?
- Can someone please tell me what is wrong with my plugin?
- Trouble with editing template for “List category posts” plugin
- WordPress function not being called from jQuery method
- AddToAny shortcode in the loop
- How to fix wrong attribute error for Visual Composer Grid Builder?
- Shortcode Plugin to dynamically build a shortcode via `do_shortcode` not working
- Making sure that a plugin’s scripts and stylesheets are included for dynamicaly loaded content
- How to Create a shortcode to this php function
- Test if php document executed by WordPress or directly
- Use $_GET inside a shortcode print empty Array
- My plugin won’t return anything [closed]
- Render Modula Plugin Shortcode On Ajax Request
- How to add a dvi tag to a shortcode then change a generated text using jQuery
- plugin shortcode not working on ajax request call
- Shortcode not working after move wordpress website files
- Shortcode not getting replaced
- Plugin that provides the [edit] shortcode?
- Return multiple values in a shortcode attribute
- Shortcode Attributes to Return different $_POST
- How to change shortcode’s default theme?
- Override/ignore CSS from active theme as not to interfere with my custom CSS
- Is there a way to convert shortcodes to html content?
- Translation issue with global variables
- Get param from shortcode in plugin function
- Loop returns the current page’s permalink and guid instead of the post in the loop
- Inserting shortcode in href – any ideas or workarounds?
- Load CSS files in header of Bones theme?
- Shortcode and variable
- How can I achieve this, using shortcodes
- Filters on the_content with plugins, pages and shortcode
- Which is a better practice when writing shortcodes: pack lots of configuration parameters or just give an id?
- Elementor Pro display featured image on section -> style -> image using shortcode
- Creating New Dynamic Fields for a Certificate (Number Generation, Code Referencing, and more)
- Help understanding dynamic endpoints based on where a shortcode is used
- How do I use a plugin’s shortcode attribute value in another function?
- Shortcode show error while editing post
- Image path in childs theme
- Get Shortcode output to database for static post_content
- Issue Saving Posts That Contain Shortcode
- Using Shortcode Result In Custom HTML Block (Using Google Sheet JQuery Result As NumScroller data-max)
- How to use plugin’s shortcode in custom design? [closed]
- Page takes on two different formats
- WP Plugin CSS not being applied to page
- Sanitize AROUND shortcode
- Get not the full path
- Multiple calling javascript from shortcode in one page
- Sending post data over REST API, how to parse shortcodes in post_content?
- How to pass value to a plugins shortcode?
- Query Shortcode from a multisite to appear on a different site?
- Find all strings between an enclosing shortcode
- Hide some shortcodes on posts from back-end
- Trouble implementing python on WordPress
- Is there a function to search for a wildcard value when calling a shortcode?
- shortcode which is introduced into entry the blog, and appears in side bar
- How to display single arbitrary facebook post with a shortcode?
- Multiple level shortcodes
- Rewrite URL to plugin file
- How to load a plugin when doing an Ajax call? [duplicate]
- Is it right way to create shortcode?
- Trying to override/intercept a PhotoMosaic gallery link in WordPress using jQuery
- Convert usernames listed by the Groups plugin shortcode to displayed names?
- Creating Features List in WordPress Post
- Global Handle to Class unavailable in Plugin?
- do_shortcodes() isn’t working
- Seo Problems in My meta Discription [closed]
- I am experiencing difficulty fulfilling client request
- How can I add a zip code service availability checker in WordPress without Woocommerce? [closed]
- Shortcode cannot parse attributes within double quotes. ” is becoming ” breaking my shortcode