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 add a shortcode button to the TinyMCE editor?
- How to customise the output of the WP image gallery shortcode from a plugin?
- How to include code only on specific pages?
- Custom media upload content for inserting custom post shortcode
- Checking if an attribute exists in a shortcode
- how to include other plugins css files in a shortcode?
- What characters are allowed as a shortcode tag and how should they be sanitized?
- All shortcodes not working on custom theme
- enqueue script only if it is not already enqueue
- Shortcode output appears before post body [duplicate]
- Autogenerate wordpress shortcodes using array?
- PHP Deprecated: Non-static method should not be called statically
- How to parse nested shortcodes?
- Loading shortcode with ajax
- Enqueue style inside shortcode but its loaded at the bottom of page (before footer scripts)
- Adding Custom Fields for Img in Posts
- How to call shortcode function directly and pass $atts
- How To Ignore a Filter On Applying Filter the Content In a Function
- Cannot strip JW Player shortcode?
- Shortcode display outside the div
- How to pass multiple values in shortcode?
- append stylesheet via shortcode
- Shortcode under a Shortcode Multiple times Possible?
- Pass $this to function nested in another public function of the same class
- change plugin shortcode function [closed]
- Calling function from within functions.php returns unwanted value
- plugin shortcodes not working on custom theme- unsure how to fix
- How to list all active and specific shortcodes in wordpress
- Dynamic HTML not displaying at respective place
- Query Shortcode from a multisite to appear on a different site?
- function of parent not working in childtheme
- Is it possible to get a shortcode generated by a plugin, then, using a function, create a new post using that shortcode?
- Find all strings between an enclosing shortcode
- Hide some shortcodes on posts from back-end
- Trouble implementing python on WordPress
- wordpress Shortocode running twice?
- Is there a function to search for a wildcard value when calling a shortcode?
- Shortcode in a blog post, footer and related products stop working
- shortcode which is introduced into entry the blog, and appears in side bar
- Editing Global Variables from Inside Functions
- Call/Run a Mathematica (.m) Shell Script from WordPress Page/Blog
- How to display single arbitrary facebook post with a shortcode?
- Multiple level shortcodes
- Custom shortcode with dynamic rewrite
- Rewrite URL to plugin file
- Using “excerpt_more” filter for a specific post type
- Posting code inside the post instead of in the template file using shortcode
- Allow user to input shortcode into wordpress widget
- How to use shortcode of any plugin to show it visually where i want?
- apply_filters to content but ignore shortcodes
- Space in WordPress Attribute Causing Problems
- Why function hooked using object are executing at all time?
- Shortcode registered from a plugin not recognized
- How to Set Limit with WordPress Get Bookmarks Shortcode
- Strange get_the_* behavior with php 5.4
- 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
- Strip shortcode from excerpt [duplicate]
- Need to change contact email depending where user is from
- Convert usernames listed by the Groups plugin shortcode to displayed names?
- Pulling RSS from site and display it in posts
- Trying to Understand Shortcodes.
- Creating Features List in WordPress Post
- Shortcode return is printing a 1 afterward
- How to use ‘Event Manager Shortcodes’ plugin via the php code? [closed]
- Embedding BitBucket Code in Posting
- Next and Previous Pagination button not displaying in WordPress
- Do shortcodes affect page indexing by search engines?
- Global Handle to Class unavailable in Plugin?
- do_shortcodes() isn’t working
- Any way to hook into WP after a page displays?
- WordPress shortcode plugin not working
- Integrate Razorpay quick payments plugin with contact form7 plugin
- WP Customer Reviews call short code on another page [closed]
- How to show in front End images using Visual Composer attach_images?
- Display HTML5 jQuery Audio Player On Front Page
- Shortcode returning specific content of a post
- Invalid argument supplied for foreach()
- Seo Problems in My meta Discription [closed]
- I am experiencing difficulty fulfilling client request
- cURL External API request displays content above other content on page
- Beginner question: Accessing js script in plugin
- Shortcode to do math with url variables
- How can I get the permalink of a page on which shortcode has been used
- Subtract Using GravityWP Count Plugin
- How to get URL param for pagination in shortcode?
- qTranslate‑X is not translating all shortcodes
- thumbnail_width not working in wordpress most popular post plugin
- Buffered output in chunks and shortcode – how do I achieve that?
- 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
- Problem with a shortcode generating a error [closed]
- Display file contents within Plugin
- How do I edit text color for shortcode?
- correct way to enqueue js and css files for wordpress shortcode?
- How to get next day date of a specific day
- Custom Plugin not Displaying in the Website Production environment (Divi)
- Can I add two wordpress shortcode plugins in the same site (not the same page)?
- How to create a dynamically created page on wordpress plugin?