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
- Creating a default Custom Post Template that a Theme can override
- Simple form that saves to database
- WooCommerce – Load Templates From Plugin For All Template Files
- How can I add a custom header to a custom template in a plugin without using the theme folders
- Developer plugin to echo template names/filepaths [closed]
- How do I make a wordpress plugin with menu item etc
- taxonomy_template filter do not loads custom taxonomy template properly
- Override comments.php template with plugin
- Woocommerce email template customization [closed]
- More than one text-domain is being used because of the included templates for plugins
- Calling custom plugin class methods from a template
- Create a custom page template inside my wordpress plugin
- Add form fields dynamically on button click
- WP plugins for building a database?
- Custom form action to handle data inside a plugin
- WP Post Template – Templates in own folder
- wp_create_nonce function doesn’t work inside a plugin?
- Image upload and other options in the same plugin settings form?
- Creating an online questionnaire form – by Importing the questions from a spreadsheet?
- Submit page limited in time to upload image
- Ajax fail and get 504 error
- How to insert HTML/JavaScript form into WordPress page? [closed]
- Trying to fix form resubmition with PRG (Getting error: Cannot modify header information – headers already sent by)
- How to fetch form data and show it to my page?
- how to force tag page layout to use same as search layout?
- Is there a way to embed a Google Docs form in a page without using plugins?
- Calling the_excerpt from inside a plugin template file
- Best practice for including plugin output in a template without using shortcode?
- Form that generates an ID for the customer
- Submit Form data to another page via Ajax (WordPress Way)
- Ajax Plugin Not Echoing Response
- Default taxonomy template in plugin, override in theme
- How to handle forms from sidebar widgets – Processing $_POST variables using get_field_name()
- Trying to add a page template for my custom post type from a plugin, but it will not display in the template dropdown unless file is in theme
- Creating a form and displaying entry data as a table
- Storing The Data Collected by Ninja Forms into Another (custom) Database [closed]
- Pagination shows Same posts
- Form Plugin for Api Requests which is used via Shortcode
- Call another page in forms
- How to Use the Filter “sidebar_login_widget_form_args”
- Select Form Element Not Saving from Plugin Options
- How can recognize post’s category?
- Contact Form 7 Plugin emails not being received by some accounts
- Using AJAX to run SQL statement and populate dropdown
- Add custom PHP and HTML to the_content()
- How to modify the Loop from a plugin (instead of a theme)
- Wp-minify doesn’t seem to minify my JS code
- Pass PHP variable to javascript
- How can I disable an attribute from a Gutenberg block included in a template via InnerBlocks?
- User loggedin as Subscriber form not sending
- How to turn my WordPress site into a ready to deploy template?
- how to display a template.php in a shortcode
- How to create a form where you can select multiple recipients, based on a list of website users?
- WordPress search input in database, to edit information via form and update the database
- Enqueue css to a third-party plugin template
- How to get data from a form on a wordpress site?
- WPForms Custom Redirect not working
- How to add post title to custom php?
- General Term for this form Field
- Why is my form going to frontend on html form submission present on the php files inside my custom plugin?
- How to access Post Archive created by Elementor?
- Programmatically generate new pages for a site based on page template and content elements accessed via DB
- 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?
- How to change the deafult template in WordPress plugin
- Pause form submissions while upgrading plugins
- 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?
- 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
- Include plugin form in the home page
- How can i see/log all requests coming from a registration form (not from the UI)?
- Form submit from wordpress plugin
- How do I convince this button to do something when it is clicked?
- Linking Plugin Files to WP
- Adding a Filter to Sidbar Login Plugin to Change Login Button Lable
- show Visual form builder in the front end
- Fake Single WordPress Post (Page) Loop
- Carrying information from button click into form [closed]
- County Finder form/plugin?
- How to develop an extension for a simple form post and post back? [closed]
- Make a Custom template for a specific category in wordpress
- WP Customer Reviews call short code on another page [closed]
- WordPress show different custom post type
- Is it possible to set different payment gateway on each Gravity Forms form? [closed]
- how to show selected options drop down menu values in attributes field in after saving post.php
- How can I add a zip code service availability checker in WordPress without Woocommerce? [closed]