Add single player shortcodes
This commit is contained in:
@@ -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' );
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user