コード例 #1
0
    /**
     * Output the metabox
     */
    public static function output($post)
    {
        $shortcodes = apply_filters('sportspress_event_shortcodes', array('event_results' => __('Results', 'sportspress'), 'event_details' => __('Details', 'sportspress'), 'event_performance' => __('Box Score', 'sportspress')));
        if ($shortcodes) {
            ?>
		<p class="howto">
			<?php 
            _e('Copy this code and paste it into your post, page or text widget content.', 'sportspress');
            ?>
		</p>
		<?php 
            foreach ($shortcodes as $id => $label) {
                ?>
		<p>
			<strong><?php 
                echo $label;
                ?>
</strong>
		</p>
		<p><input type="text" value="<?php 
                sp_shortcode_template($id, $post->ID);
                ?>
" readonly="readonly" class="code widefat"></p>
		<?php 
            }
            ?>
		<?php 
        }
    }
コード例 #2
0
    /**
     * Output the shortcode metabox
     */
    public static function shortcode($post)
    {
        ?>
		<p class="howto">
			<?php 
        _e('Copy this code and paste it into your post, page or text widget content.', 'sportspress');
        ?>
		</p>
		<p>
			<strong><?php 
        _e('Bracket', 'sportspress');
        ?>
</strong>
		</p>
		<p><input type="text" value="<?php 
        sp_shortcode_template('tournament_bracket', $post->ID);
        ?>
" readonly="readonly" class="code widefat"></p>
		<p>
			<strong><?php 
        _e('Winner', 'sportspress');
        ?>
</strong>
		</p>
		<p><input type="text" value="<?php 
        sp_shortcode_template('tournament_winner', $post->ID);
        ?>
" readonly="readonly" class="code widefat"></p>
		<?php 
    }
    /**
     * Output the metabox
     */
    public static function output($post)
    {
        ?>
		<p class="howto">
			<?php 
        _e('Copy this code and paste it into your post, page or text widget content.', 'sportspress');
        ?>
		</p>
		<p>
			<strong><?php 
        _e('Details', 'sportspress');
        ?>
</strong>
		</p>
		<p><input type="text" value="<?php 
        sp_shortcode_template('player_details', $post->ID);
        ?>
" readonly="readonly" class="code widefat"></p>
		<p>
			<strong><?php 
        _e('Statistics', 'sportspress');
        ?>
</strong>
		</p>
		<p><input type="text" value="<?php 
        sp_shortcode_template('player_statistics', $post->ID);
        ?>
" readonly="readonly" class="code widefat"></p>
		<?php 
    }
    /**
     * Output the metabox
     */
    public static function output($post)
    {
        $the_format = get_post_meta($post->ID, 'sp_format', true);
        if (!$the_format) {
            $the_format = 'calendar';
        }
        ?>
		<p class="howto">
			<?php 
        _e('Copy this code and paste it into your post, page or text widget content.', 'sportspress');
        ?>
		</p>
		<p><input type="text" value="<?php 
        sp_shortcode_template('event_' . $the_format, $post->ID);
        ?>
" readonly="readonly" class="code widefat"></p>
		<?php 
    }