You could create a custom post type post_templates
. It should not be publicly queryable, and the admin only should be able to create or edit items.
In your post editor you could then add a TinyMCE button/dropdown to let the editor select a template. Here is a very basic example plugin illustrating how to work with preselected post content:
/*
* See wp-admin/includes/post.php function get_default_post_to_edit()
* There are also the filters 'default_title' and 'default_excerpt'
*/
add_filter( 'default_content', 't5_preset_editor_content', 10, 2 );
/**
* Fills the default content for post type 'post' if it is not empty.
*
* @param string $content
* @param object $post
* @return string
*/
function t5_preset_editor_content( $content, $post )
{
if ( '' !== $content or 'post' !== $post->post_type )
{
return $content;
}
return 'This is the <em>default</em> content. You may customize it.';
}
Related Posts:
- Custom form not showing in correct place on page
- Create custom page templates with plugins?
- Is there a WordPress plugin that registers a plugin file as a custom page template?
- Is it possible to stop selected plugins from loading on certain template pages?
- Ways to have multiple front-page.php templates that can be swapped out?
- Register Page Template from Plugin
- Plugin-generated pages use Not Found or Pages Archive templates?
- How to use get_template part in the plugin?
- Ajax Call in page theme not working?
- How do I show content from a plugin using the template the site is currently working with?
- Pull comments from one page/post into another page/post?
- How to provide page_template path in custom plugin using WordPress
- Plugin to manage form submissions on admin panel
- WordPress Product Detail and catalog
- How to send custom mail when a user complete a specific form
- how do i fixe Page Builder on a custom page?
- How to submit custom form data using ajax to HubSpot form?
- Ajax call to php function doesn’t work PHP code
- How to change the deafult template in WordPress plugin
- Plugin json page
- Customize plugin templates
- WordPress arrows dissapeared strange signs
- submit form data to wordpress existing database table using my plugin
- Page takes on two different formats
- After form submission want to show success message in the form page
- WordPress form submit to custom page template does not work
- Template conflict with WC Payment Method
- How to use custom footer template in a site-plugin?
- get/show Last ID
- Why is WP template_include overwritting all templates rather than specified page?
- Pause form submissions while upgrading plugins
- How to add HTML to a template only when user is logged out/ not registered
- Passing variable from template file to the plugin file
- How to differently style pages that display posts of different category in WordPress?
- How to hide the form after successful php execution
- How can I automatically send an email with an excel file containing submissions for a form rather than an email per submission?
- Adding a custom page template to a plugin generated page
- History of page, interval of years
- Why doesn’t a form need an ‘action’ with a plugin that uses the post data?
- $POST variable is empty in receiving php add-on function but can be seen by jscript function
- How to echo a plugin’s function into a template?
- How to add dynamic content to posts page, archive, taxonomies, search, author, etc?
- WP plugin calls for custom pages
- Custom Page Templates for a complex application – code must sit in a plugin and not the Theme
- custom template only for content
- WP_Filesystem usage within a block of code
- Convert HTML5/CSS3 site to WordPress Theme (need a lot of plugins) or just use the API?
- I created a custom form in HTML/CSS and now I need it to submit … should I create custom PHP or is there a plugin I can use?
- Is there a function to search for a wildcard value when calling a shortcode?
- Include plugin form in the home page
- Submit form to another template (ugly url)
- How can i see/log all requests coming from a registration form (not from the UI)?
- Form submit from wordpress plugin
- Create user assessment and use results in sql query
- Saving custom form fields
- How do I convince this button to do something when it is clicked?
- wordpress option page data from select form is not saving to database
- Linking Plugin Files to WP
- Adding a Filter to Sidbar Login Plugin to Change Login Button Lable
- Create plugin with form in post and submit it to specific form
- Is there any simple wordpress search template that works with existing searchforms?
- show Visual form builder in the front end
- Fake Single WordPress Post (Page) Loop
- Carrying information from button click into form [closed]
- Link Forms on WordPress
- Custom Form only for admin
- WordPress multisite haml templates
- Capturing POST data
- How to make plugin work in each template in wordpress
- County Finder form/plugin?
- Creating fields in the database
- Allow users to enter and edit data in one-to-many configuration
- [Custom field template plugin] Upload limited to 20 inputs file
- Undefined variable _POST
- Plugin Admin Page Ajax-Admin call returning 0, URL set correctly. Implemented localized scripts but did not fix it
- How to prevent page load on form submission
- Sort Reviews/Ratings by date on Woocommerce
- How to develop an extension for a simple form post and post back? [closed]
- How to create a page template using custom plugin
- Make a Custom template for a specific category in wordpress
- Can’t edit Contact Us form on front page
- WP Customer Reviews call short code on another page [closed]
- Plugin Beauty Contact Popup Form with while loop
- Build a Boat Form Plugin [closed]
- WordPress show different custom post type
- Display HTML5 jQuery Audio Player On Front Page
- How to get an error message if a form is empty (plugin: Post for site) [closed]
- Template library for WordPress [closed]
- Is it possible to set different payment gateway on each Gravity Forms form? [closed]
- Divi Template A Few Questions
- My Blog page ( posts page ) theme isn’t changing with the new theme [closed]
- How to display content depending on the Woocommerce Product Category
- how to show selected options drop down menu values in attributes field in after saving post.php
- Redirecting to page on form submit – Revue plugin
- How to Allow Users to Select Recipients In a WordPress Comment section?
- WP Donation Form with custom payment API
- Resources for building a custom event page template
- Is there a plugin or another way that can help me find out the underlying files of a page/post? [closed]
- Form with response button after on table after submission
- Tips on using a custom template with Ultimate Member