Your shortcode calls wp_list_post_revisions() which echo the output (revision list), hence you get the “updating error”.
To fix the issue, you can use output buffering like so:
ob_start();
wp_list_post_revisions( get_the_ID() );
$revisions = ob_get_clean();
Or you could use wp_get_post_revisions() and build the HTML list manually. Here’s an example based on the wp_list_post_revisions():
$output="";
if ( ! $revisions = wp_get_post_revisions( get_the_ID() ) ) {
return $output;
}
$rows="";
foreach ( $revisions as $revision ) {
if ( ! current_user_can( 'read_post', $revision->ID ) ) {
continue;
}
$rows .= "\t<li>" . wp_post_revision_title_expanded( $revision ) . "</li>\n";
}
$output .= "<ul class="post-revisions hide-if-no-js">\n";
$output .= $rows;
$output .= '</ul>';
// At the end of your shortcode function, make sure to..
return $output;
Related Posts:
- How to add a shortcode button to the TinyMCE editor?
- how to include other plugins css files in a shortcode?
- What characters are allowed as a shortcode tag and how should they be sanitized?
- Autogenerate wordpress shortcodes using array?
- A Blog’s changelog
- Enqueue style inside shortcode but its loaded at the bottom of page (before footer scripts)
- Shortcode under a Shortcode Multiple times Possible?
- do_shortcode() doesn’t work if shortcode contained in variable, works if shortcode passed as string
- Layout shop page: resize images and columns
- How to add inline css/js inside a shortcode
- how to show database content in wordpress post
- wp_specialchars and wp_specialchars_decode in a shortcode plugin
- Only execute jQuery function(on document ready) on the page has shortcode from plugin [duplicate]
- Shortcode in AJAX popup
- New Plugin: Post update pushes a copy as a revision
- echo do_shortcode is not working on theme’s template
- Can I use a Shortcode output as an HTML attribute value?
- Shortcode to generate and save password in a file
- Overriding Attributes values in Shortcode Plugins
- Demystifying and understanding shortcode nomenclature
- How to modify shortcode attributes with data from current post
- Confused about shortcode and settings values
- Running jquery script after shortcode [closed]
- Add htmlentities and/or shortcode into data-attributes
- Any Short code Availble for Get Post List With Thumbnail Plugin?
- Where to call add_shortcode function in WordPress Plugin Boilerplate?
- Plugin echos text from shortcode function in gutenberg page editor
- Plugin shortcodes not working in custom theme
- tag breaks shortcode output (other solutions don’t work)
- Allow users of my plugin to define their own shortcode rather than use mine?
- wordpress prevent multiple shortcodes
- WordPress Shortcode to get URL Parameters $_GET[‘name’] redirects for no reason at all
- creating html reusable blocks via shortcodes
- add_shortcode is not working in plugin where others are working
- Best place for short bio,image and button [closed]
- Some code in shortcode function being ignored
- Unable to add TAB character to post?
- How do I apply style to each category of a list?
- Where are theme codes located for WordPress?
- Anyway to convert a plugin to become a shortcode?
- How can I run a custom shortcode function on a live site and only run if the viewer is a specific machine?
- Displayed content disappears when adding attributes to shortcode
- Modify page title and subtitle with a plugin
- How do I pass custom shortcode-extracted variables (taxonomy) into a query function for WordPress RoyalSlider?
- Flipping Book PHP Code? Any experience?
- WPTouch – how to remove shortcodes or make shortcodes function
- Custom shortcode for displaying user based on a role parameter
- WordPress Plugin Insert Html Code with Shortcode
- shortcode – multiple instances of same parameter name in one shortcode instance
- Function call in wordpress short code handler fails
- strange shortcode error: does shortcodes requires any dependency?
- wp_localize_script not passing the data
- Get post content from outside the loop with plugin shortcode usability
- Is there any way to inject text onto pages?
- Create Short code dynamically
- Get variable value based on string constant
- grab or load text on demand
- How can I replace content on site generated from plugin without changing plugin
- Rename Smart YouTube’s httpv back to http for all posts
- How to use a shortcode or an application to dynamically embed content from one WordPress site to another?
- WordPress load same script two times
- how to display a template.php in a shortcode
- Get a value from a shortcode for another function
- Shortcode do not return the right data in post
- How to call function in WordPress on button click?
- Why does my custom plugin only function correctly once per page?
- Hide content for specific users with id
- JS working when used normally but not in wordpress
- WordPress Shortcodes – Return $Variable
- using WPPB shortcodes without the plugin
- save short-code in my custom plugin settings problem missed something
- How to pass multiple custom fields as shortcode’s parameters
- Do_shortcode before send email content
- Get shortcode attribute for AJAX call
- How to use a shortcode of a plugin in another plugin php file
- Bootstrap carousel – Using shortcode inside enclosing shortcode
- How to store multiple instances of the plugin’s options for various shortcodes
- Modify Plugin shortcode function code
- Meta box or shortcode help
- wordpress Shortocode running twice?
- Shortcode in a blog post, footer and related products stop working
- Call/Run a Mathematica (.m) Shell Script from WordPress Page/Blog
- Using “excerpt_more” filter for a specific post type
- Allow user to input shortcode into wordpress widget
- How to use shortcode of any plugin to show it visually where i want?
- How to Set Limit with WordPress Get Bookmarks Shortcode
- Need to change contact email depending where user is from
- Pulling RSS from site and display it in posts
- Shortcode return is printing a 1 afterward
- How to use ‘Event Manager Shortcodes’ plugin via the php code? [closed]
- WordPress shortcode plugin not working
- WP Customer Reviews call short code on another page [closed]
- Display HTML5 jQuery Audio Player On Front Page
- Shortcode returning specific content of a post
- Invalid argument supplied for foreach()
- Shortcode to do math with url variables
- How can I get the permalink of a page on which shortcode has been used
- How to get URL param for pagination in shortcode?
- Buffered output in chunks and shortcode – how do I achieve that?
- How to get next day date of a specific day