You can’t just print output from a shortcode, you have to return it. Easiest way given your existing code is to use an output buffer. You can modify your draw_chain_menu()
method like this:
//shortcode action
public function draw_chain_menu($args) {
// previous code omitted...
ob_start();
$this->generate_tax_select($args);
return ob_get_clean();
}
Related Posts:
- Error Warning: Declaration of description_walker::start_el after PHP upgrade [duplicate]
- WordPress Warning: preg_replace(): JIT compilation failed: no more memory
- Autoloading in Child Theme
- WSOD but WP_DEBUG not giving any errors
- Rename image uploads replacing “width” and “height” in filename with “medium”, “large”, “small”
- Append code into wp-config.php
- How to turn off redirection from ‘domain.com/login’ to ‘domain.com/wp-login.php’
- Looking for a better way to handle an ajax script that pulls in post data on click
- add_rewrite_rule with bottom priority doesn’t handle the WordPress pages
- Adding featured image via PHP
- How to strip non-alphanumeric characters, convert spaces to dashes, uppercase to lowercase in this context
- How to return multiples lines in a shortcode?
- wp_enqueue_style with style.php and WordPress functions
- fallback image for featured image
- How to set status codes such as 401 and 403?
- Minify HTML, CSS, JS with PHPWee?
- Add attribute / custom attribute to product in woocommerce
- Access/update database with jQuery
- How to create another version of my site based on the same database
- How to get bool with `get_option()` when already registered setting with type `boolean`
- How do themes render caption texts in extended markup (e.g. “wp-caption” paragraphs)
- Count the number of times the search form template gets included on a page
- Displaying theme options in css
- PHP code inside shortcodes
- PHP help get_template_directory + PHP include
- Latest post in a specific menu
- Querying wpdb using PHP
- Reload part of checkout on changed shipping method
- how to combine wordpress htaccess on my root domain + php on subfolder
- Input data from email form not going to JSON file
- Should `wp_login` be used since it’s deprecated?
- admin-ajax Firing Error 400 When Logged In
- How to use a custom hook
- Hide HTML element (by class or ID) with PHP
- wp_force_remove_style’ not found
- Pagination on Custom Post
- How to check $_GET isset for a parameter and value? [closed]
- Why can’t I return a value from $wpdb->get var?
- how to save checkbox data for custom setting?
- How to keep the capability of users and disable Gutenberg editor in WordPress?
- change title page on search result
- Enqueing External JS on the remote server JS
- Refactoring long if/else php chains
- Trouble with a php code that adds a log in/log out button [closed]
- How to add aria role and schema markup to custom walker container
- jQuery accordion menu
- Restrict characters in comment section
- Required PHP version: 5.3.3 – Version found: 5.2.17… How or where do upgrade to 5.33 [closed]
- Adding custom url to readmore link using get_permalink()
- Remove submenu item from list
- is_user_logged_in returning nothing on custom page
- Customize field names in backend profile edit page through function.php [duplicate]
- Getting text from custom field from customizer
- WordPress navigation wont appear with wp_head
- WordPress: Export/Import Yoast meta title & description to custom taxonomy
- Page not visible in ‘All pages’ after being added through PHP
- How to exclude labels from certain categories in a shortcode?
- Pass a PHP function to javascript
- Nested Queries of decreasing specificity
- Wrong pagination results, page counter resets when navigating
- How can I update WordPress plugins or WordPress itself in all server?
- WooCommerce Query Product Titles
- Replace jQuery with PHP or CSS for Customized WordPress wp_nav_menu
- Check $post->ID against multiple values
- alternate left – right content inside the loop
- I have a lot of JavaScript erorrs after SSL someone can help me?
- why not selecting multiple rows of same standard_id using SQL query from database?
- Rewrite rule for wp
- Show the subcategory name based on current product
- Why my Ajax events are no longer detected after dynamic change of shortcode content
- Add function to head “no product found”
- How to separate the taxonomies list from the form so that editing taxonmies is the same as pages and posts?
- How to make this code valid only when the value exists?
- getting the values of hidden inputs to use them in a php mysql query
- How to include a function in a template with template tag
- wordpress all post filter by year
- Bootstrap Carousel Indicators Won’t Cycle On Custom WordPress Theme
- Use header option on wp-login page with a second logo
- Pulling a variable into the wp_nav_menu function
- Post added by PHP redirects to 404 [closed]
- dropdown with no submit
- Plugin PHP write permissions
- If custom field doesn’t exist, or exists and it’s true show title?
- Add the “.current-menu-item” class to tag?
- Custom fields randomly stop working
- WXR XML import is stripping php tags that I need to keep
- How to remove parent section in an attachment URL in wordpress?
- how to iterate through xml data?
- Adding slides to an existing carousel manually
- Shortcode to include PHP file, pass various parameters to include?
- Why can’t I include echo inside a variable? [closed]
- WP_Query not returning results
- Really slow WordPress site [closed]
- $post->ID calls for current page, but what is the code to call for any new page created and published in WordPress?
- How to increase excerpt length in wordpress? [duplicate]
- Are WordPress & PHP objectively and based on evidence going to die because the future is made of frontend rendering instead of server side rendering? [closed]
- Not able to see the error [closed]
- How do I link the side images?
- Differences and dis/advanages between: Fast-CGI, CGI, Mod-PHP, SuPHP, PHP-FPM
- Custom plugin doesn’t show in admin menu – when code added, displays an empty page