Create front-facing input forms
<?php CFS()->form( $params ); ?>
$params
defaults:
<?php
$params = array(
'post_id' => false, // by default, add new post
'post_title' => false, // set to true to edit the title
'post_content' => false, // set to true to edit the content
'excluded_fields' => array(), // array of field names
'confirmation_url' => '', // redirect URL
'submit_label' => 'Submit',
);
Examples
(Required) Add the following code to load all required form assets
<?php CFS()->form->load_assets(); ?>
Create a new post
<?php
echo CFS()->form( array(
'post_id' => false,
'post_type' => 'post',
) );
Edit the current post
<?php
echo CFS()->form( array( 'post_id' => $post->ID ) );
Edut the current post, including the title and body
<?php
echo CFS()->form(array(
'post_id' => $post->ID,
'post_title' => 'The Title',
'post_content' => 'The Content',
));
Edit a specific post (ID = 123)
<?php
echo CFS()->form( array( 'post_id' => 123 ) );