I played around with the plugin files and was able to figure it out myself. For anyone who’s wondering, you can use wp_insert_post
. You just need to find what variable the generated shortcode is stored in, which can take a little digging through the plugin files. For the plugin I was working with, it went something like this:
$my_poll = array(
'post_content' => '[name_of_shortcode name_of_shortcode_attribute=" . $poll->_id . "]',
'post_status' => 'publish'
);
wp_insert_post($my_poll);
Related Posts:
- How To Ignore a Filter On Applying Filter the Content In a Function
- Dynamic HTML not displaying at respective place
- Unable to add TAB character to post?
- Redirect to another page using contact form 7? [closed]
- Is it possible to pin a post in second position from top
- How to display single arbitrary facebook post with a shortcode?
- How to use shortcode of any plugin to show it visually where i want?
- Embedding BitBucket Code in Posting
- Next and Previous Pagination button not displaying in WordPress
- Shortcode returning specific content of a post
- Show Similar Post Titles ( Similar to Stack Exchange )
- How do I unlock a post programmatically?
- All shortcodes not working on custom theme
- How to work with Syntax Highlighter Evolved?
- User-Specific Timezones? Hack? Plugin?
- enqueue script only if it is not already enqueue
- How to parse nested shortcodes?
- jQuery plugin only in one page/post
- Add image to post from external URL
- Share buttons on article footer
- How to create a Page alias in WordPress
- change plugin shortcode function [closed]
- How to extract images of post and pages excluding header and logo image in wordpress?
- How to filter content post only on save
- Short code for Venues
- Shortcode doesn’t work if I directly paste its function in a template file?
- How use %like% in sql statement wordpress
- How to generate CSS from a shortcode within a plugin
- How to get 1 or 2 specific posts on top of my wordpress blog?
- How to remove html code in excel downloads using phpspreadsheet with wordpress plugins shortcode
- With W3 Total Cache when I publish a post it does not appear in the homepage. Only if i purge all cache [closed]
- Hiding posts – WP Hide Post not working
- submit posts by unregistered users in wordpress
- 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
- Any built-in function to associate a post to category through a plugin?
- WordPress function not being called from jQuery method
- Two problems on my WordPress installation [closed]
- Making sure that a plugin’s scripts and stylesheets are included for dynamicaly loaded content
- How to pull email and name from Flamingo plugin
- Use $_GET inside a shortcode print empty Array
- How to delete all trashed item in one-go
- Render Modula Plugin Shortcode On Ajax Request
- How to add a dvi tag to a shortcode then change a generated text using jQuery
- Shortcode not getting replaced
- Don’t publish/update a post when a plugin finds errors in custom fields
- Shortcode Attributes to Return different $_POST
- Get param from shortcode in plugin function
- Inserting shortcode in href – any ideas or workarounds?
- I would like to remove date display on photo preview
- Change website directory safely to add a static page on startup
- Show related posts based of current ACF field name in a single page post (a loop within loop)
- Load CSS files in header of Bones theme?
- WordPress “Add new tag” button is not working
- 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?
- Problem with ajax plugin for refreshing posts
- Somehow adding to “Insert Into URL” posts are contradicting each other
- Add posts from other WordPress blog to the current one
- Link Posts to External URL
- How do I allow users to supply a photo/image to be used instead of the grey/white silhouette?
- Help understanding dynamic endpoints based on where a shortcode is used
- How to display the custom post related blog by category?
- WP Forms not displaying,becomming an fatal error
- How do I use a plugin’s shortcode attribute value in another function?
- Image path in childs theme
- wp_insert_post() Add and specific ID to the body of that
- Pagination (including title of each page) in a post for a long posts
- Page takes on two different formats
- Sanitize AROUND shortcode
- Get not the full path
- Sending post data over REST API, how to parse shortcodes in post_content?
- Include post_date in search
- Query Shortcode from a multisite to appear on a different site?
- Add Filter to get_next_posts_link
- WordPress Dashboard organize posts based on categories
- Find all strings between an enclosing shortcode
- Add new post using a page inside the website
- Is there a function to search for a wildcard value when calling a shortcode?
- Multiple level shortcodes
- How to load a plugin when doing an Ajax call? [duplicate]
- Related posts popup
- Trying to override/intercept a PhotoMosaic gallery link in WordPress using jQuery
- Find And Add Category to Posts
- Get page type to display content
- Insert data in custom table during new post creation
- Capturing POST data
- Get a submitted value from front end post form for single template
- Automatically set posts to NoIndex depending on category?
- Notification When Post Approved
- Creating Features List in WordPress Post
- Windows 10 Printer that Sends to WordPress [closed]
- I am experiencing difficulty fulfilling client request
- My Blog page ( posts page ) theme isn’t changing with the new theme [closed]
- Shortcode to do math with url variables
- How to get URL param for pagination in shortcode?
- Buffered output in chunks and shortcode – how do I achieve that?
- Getting 400 Error in wordpress website