示例#1
0
				<!-- gotta nonce -->
				<?php 
    wp_nonce_field('bank106_form_add_assignment', 'bank106_form_add_assignment_submitted');
    ?>
			
				<!-- hidden data stored for preview use -->
				<input type="hidden" id="thingName" value="<?php 
    echo THINGNAME;
    ?>
" />
				<input type="hidden" name="assignment_thumb_id"  value="<?php 
    echo $assignment_thumb_id;
    ?>
" />
				<input type="hidden" id="embedMedia" value="<?php 
    echo htmlentities(get_media_embedded($assignmentURL));
    ?>
" />
		
				<?php 
    if ($use_public_ratings) {
        ?>
					<input type="hidden" id="embedRating" value="<?php 
        echo htmlentities($ratingsHTML);
        ?>
" />
				<?php 
    } else {
        ?>
					<input type="hidden" id="embedRating" value="-1" />
				<?php 
示例#2
0
" />
					
					<?php 
            if ($use_full_editor) {
                ?>
						<!-- hidden data stored for preview use -->
						<input type="hidden" id="assignmentURL" value="<?php 
                echo get_permalink($aid);
                ?>
" />
						<input type="hidden" id="assignmentTitle" value="<?php 
                echo get_the_title($aid);
                ?>
" />
						<input type="hidden" id="embedMedia" value="<?php 
                echo htmlentities(get_media_embedded($exampleURL));
                ?>
" />		
					<?php 
            }
            ?>
		
				<div class="form-group">
					<label for="submitexample"><?php 
            _e('Review and Submit this ' . ucfirst($sub_type), 'wpbootstrap');
            ?>
</label>
					
					
					<div class="row">
						<div class="col-xs-4 col-md-3">
示例#3
0
function get_example_media($pid, $metafieldname = 'fwp_url')
{
    // output link to example, display media or embeded media if example is embeddable
    $str = '';
    // hold output
    if (get_post_meta($pid, $metafieldname, true)) {
        // url for example of assignment
        $assignmentURL = get_post_meta($pid, $metafieldname, true);
        // case to handle an example with no URL, return empty string
        // Just check the first character because people seem to think this is a hash tag!
        if ($assignmentURL[0] == "#") {
            return '';
        }
        if (url_is_type($assignmentURL, array('mp3'))) {
            // option for href to make as a download
            $download_option = ' download';
        }
        // make header
        $str .= '<p class="example-url"><strong>Example for "' . get_the_title($pid) . '":</strong><br /><a href="' . $assignmentURL . '"' . $download_option . '>' . $assignmentURL . ' </a></p>';
        // add on the embedded media
        $str .= get_media_embedded($assignmentURL);
    }
    return $str;
}