Add single player shortcodes

This commit is contained in:
Brian Miyaji
2014-07-12 02:31:42 +10:00
parent da3bf43787
commit 563f646866
5 changed files with 109 additions and 0 deletions

View File

@@ -150,6 +150,7 @@ class SP_Admin_Meta_Boxes {
add_meta_box( 'sp_editordiv', __( 'Description', 'sportspress' ), 'SP_Meta_Box_Table_Editor::output', 'sp_table', 'normal', 'low' );
// Players
add_meta_box( 'sp_shortcodediv', __( 'Shortcodes', 'sportspress' ), 'SP_Meta_Box_Player_Shortcode::output', 'sp_player', 'side', 'default' );
add_meta_box( 'sp_columnsdiv', __( 'Columns', 'sportspress' ), 'SP_Meta_Box_Player_Columns::output', 'sp_player', 'side', 'default' );
add_meta_box( 'sp_detailsdiv', __( 'Details', 'sportspress' ), 'SP_Meta_Box_Player_Details::output', 'sp_player', 'side', 'default' );
add_meta_box( 'sp_metricsdiv', __( 'Metrics', 'sportspress' ), 'SP_Meta_Box_Player_Metrics::output', 'sp_player', 'side', 'default' );

View File

@@ -0,0 +1,36 @@
<?php
/**
* Player Shortcode
*
* @author ThemeBoy
* @category Admin
* @package SportsPress/Admin/Meta_Boxes
* @version 1.2
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
/**
* SP_Meta_Box_Player_Shortcode
*/
class SP_Meta_Box_Player_Shortcode {
/**
* 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="[player_details <?php echo $post->ID; ?>]" readonly="readonly" class="wp-ui-text-highlight code"></p>
<p>
<strong><?php _e( 'Statistics', 'sportspress' ); ?></strong>
</p>
<p><input type="text" value="[player_statistics <?php echo $post->ID; ?>]" readonly="readonly" class="wp-ui-text-highlight code"></p>
<?php
}
}