This is more about php than wp, but ob_get_contents
returns the buffer without clearing it. So you get your buffer content twice. Use ob_get_clean
to erase the buffer on returning it.
Related Posts:
- Retrieve multiple values passed to a single attribute in a shortcode
- Display a text message if the shortcode is not found?
- Loading page template into shortcode
- Custom plugin issue when trying to use the shortcode twice on a page [closed]
- Making Quote Plugin more efficient
- custom shortcode will not display the wrapped content
- Append HTML Using Shortcode
- Plugin CSS not enqueing
- Is it possible to define variables in a wordpress shortcode, and then call the shortcode using a specific variable?
- WordPress shortcode returns the data before
- Action Hook Inside WordPress Plugin Shortcode
- What is the difference between Null vs Empty (Zero Length) string?
- How to Create custom block for displaying information in content section which act like shortcode
- Display a custom name when the user has no name settle in his account
- overwrite wordpress gallery with custom gallery shortcode
- How to return html as a string from php for WordPress
- Shortcode Works for Logged in Users but Not Working for Guest
- using a shortcode in a hyperlink
- WP Custom tables query
- Custom plugin with shortcode not working
- error_log() output for print_r() appearing on page
- Allow only 1 taxonomy per custom post type [duplicate]
- Do I require the use of nonce?
- Display sorting options dropdown when using WooCommerce product category shortcode
- Export User Info to CSV from Front End
- How to change date language without changing the entire site language?
- Counting number of posts in a category and its sub categories and displaying result using shortcode
- Shortcode created to check language not works
- Save selected item from dropdown menu in a meta box as a metadata value for a custom post type
- Add/echo div with Analytics-Code to function in functions.php
- OOP Plugin Development. Including external object
- Authenticating to WordPress, using my own authentication two-factor system
- Use composer to load custom classes [closed]
- Database “Migration” for Plugins?
- WordPress menu deletes when trying to add a hook
- How to find the output of contact form 7 shortcode? [closed]
- How do i get (unique) page name?
- Does wp-cron runs all tasks scheduled at same time together or one after other?
- Can A Shortcode Get HTML/Text From Content And Return It Twice With Added HTML?
- Browser title script ignoring is_page /else conditional [closed]
- How to limit the content coming from wordpress shortcodes?
- How do I use the Simple HTML DOM Parser in plugin when other plugin already uses it?
- Will simple function names in a class structure conflict with other plugins?
- Instantiate class to be available to all plugin functions
- How to test nonce with AJAX – Plugin development
- Create shortcodes within foreach loop (using array)
- WP nonce invalid
- How can i upload images in an admin page?
- How to display data from custom table in wordpress phpmyadmin
- Retrieve $_POST data submitted from external URL in WordPress(NOT API)
- Reprinting tags with all attributes
- Update results, Before deleting the related category [closed]
- Adding function to Genesis genesis_header [closed]
- How create a Shortcode with hover and complex options
- Remove from shortcode
- how to update and display an option without reloading the page
- Only first shortcode gets executed
- How to obtain the current website URL in my theme?
- echo something inside a shortcode
- Plugin Generate Unexpected output during activation
- Undefined method class::construct() when creating a plugin
- Hook called before text widget save
- wpdb prepare insert table doesn’t work
- Shortcode for Listing Users from Meta Value?
- Shortcode to log user into current URL
- How can I display Custom Post type Custom Columns and its Content in a Dashboard Widget?
- Calling PHP Titles inside Javascript Markup
- custom plugin with upload files does not work
- Including Custom fields within the_content
- send popup after wp_redirect()
- no_rest_route error on custom routes
- Show Featured Image Dimensions and size frontend with shortcode
- How to work Woocommerce pagination inside shortcode?
- Create ACF Checkbox to get all ACF Values from Parent Page
- Display Visual Composer shortcode if a post belongs in specific categories
- Trying to create a shortcode to display categories with a specific product tag
- How to pass parameters in wordpress shortcode?
- File is executed twice if plugin is activating
- product_type_options get saved value [closed]
- How can I prevent a shortcode div from extending beyond its boundaries?
- Hide content for specific users with id
- Adding variable in WordPress shortcode
- Execute Shortcode in Textfile
- custom taxonomies not working
- Sum All the Post Meta of Published posts of Current Logged in user
- How to output values from a loop into a javascript array
- Autoloading Classes in Plugins
- Comparing Dates within plugin using PHP If statement
- Short code into PHP
- Singleton plugin activation; create database
- Shortcode At top of Page – PHP 5.5 vs 5.4 – ob_start();
- Using the same shortcode to show any table from the database
- How to get WordPress Adminmenu items?
- How keep woocommerce users separeted in multisite install and keep admins on network
- Is there a better way to output HTML as a shortcode?
- Gutenberg – render_callback does not pass ToggleControl value on frontend
- Prevent users from display default wordpress login form
- Create custom table for wordpress custom registration flow
- Authenticate + Authorize WP REST API request before built-in WP JSON Schema Payload Validation?
- WordPress wp_set_object_terms does not assign product to custom taxonomy