Created
April 5, 2017 11:38
-
-
Save andrewlimaza/98662ff13c6131c2314352b1ef6773c8 to your computer and use it in GitHub Desktop.
Caldera Form example for frontend post creation to show only for admins.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Example for front end post edit with Caldera Forms. Use code to show a Caldera Form at the bottom of a single post if user is an Administrator for WordPress. | |
*/ | |
add_filter( 'the_content', 'show_cf_form_for_admins' ); | |
function show_cf_form_for_admins( $content ) { | |
if( is_single() && current_user_can( 'manage_options' ) ){ | |
$content .= Caldera_Forms::render_form( 'CF58e4c8ae55fa2' ); //change to your form ID you would like to display. | |
} | |
return $content; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment