Last active
August 29, 2015 14:20
-
-
Save laurencebradford/63bc80ee5357f1459e78 to your computer and use it in GitHub Desktop.
This file contains 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
// shortcode form | |
function shortcode_form( $atts, $content = null ) { | |
extract( shortcode_atts( array( | |
'type' => '', /* */ | |
), $atts ) ); | |
$template = ''; | |
$return = ''; | |
if($type == 'html') { | |
$template .= TEMPLATEPATH . '/forms/html-giveaway.php'; | |
} | |
if($type == 'css') { | |
$template .= TEMPLATEPATH . '/forms/css-giveaway.php'; | |
} | |
if($type == 'python') { | |
$template .= TEMPLATEPATH . '/forms/python-giveaway.php'; | |
} | |
if($type == 'tips-form') { | |
$template .= TEMPLATEPATH . '/forms/coding-tips-form.php'; | |
} | |
if( $template ) { | |
ob_start(); | |
include( $template ); | |
$return = ob_get_clean(); | |
} | |
return $return; | |
} | |
add_shortcode('form', 'shortcode_form'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment