コード例 #1
0
/**
 * sensei_start_course_form function.
 *
 * @access public
 * @param mixed $course_id
 * @return void
 */
function sensei_start_course_form($course_id)
{
    $prerequisite_complete = sensei_check_prerequisite_course($course_id);
    if ($prerequisite_complete) {
        ?>
<form method="POST" action="<?php 
        echo esc_url(get_permalink());
        ?>
">

    			<input type="hidden" name="<?php 
        echo esc_attr('woothemes_sensei_start_course_noonce');
        ?>
" id="<?php 
        echo esc_attr('woothemes_sensei_start_course_noonce');
        ?>
" value="<?php 
        echo esc_attr(wp_create_nonce('woothemes_sensei_start_course_noonce'));
        ?>
" />

    			<span><input name="course_start" type="submit" class="course-start" value="<?php 
        _e('Start taking this Course', 'woothemes-sensei');
        ?>
"/></span>

    		</form><?php 
    }
    // End If Statement
}
コード例 #2
0
/**
 * sensei_wc_add_to_cart function.
 *
 * @access public
 * @param mixed $course_id
 * @return void
 */
function sensei_wc_add_to_cart($course_id)
{
    $prerequisite_complete = sensei_check_prerequisite_course($course_id);
    if ($prerequisite_complete) {
        global $woothemes_sensei, $post;
        $woothemes_sensei->frontend->sensei_get_template('woocommerce/add-to-cart.php');
    }
    // End If Statement
}