Add team table columns shortcode close #32
This commit is contained in:
@@ -136,6 +136,7 @@ class SP_Admin_Meta_Boxes {
|
||||
add_meta_box( 'sp_editordiv', __( 'Description', 'sportspress' ), 'SP_Meta_Box_Calendar_Editor::output', 'sp_calendar', 'normal', 'low' );
|
||||
|
||||
// Teams
|
||||
add_meta_box( 'sp_shortcodediv', __( 'Shortcodes', 'sportspress' ), 'SP_Meta_Box_Team_Shortcode::output', 'sp_team', 'side', 'default' );
|
||||
add_meta_box( 'sp_detailsdiv', __( 'Details', 'sportspress' ), 'SP_Meta_Box_Team_Details::output', 'sp_team', 'side', 'default' );
|
||||
if ( isset( $post ) && isset( $post->ID ) ):
|
||||
if ( get_the_terms( $post->ID, 'sp_league' ) && get_the_terms( $post->ID, 'sp_season' ) ) add_meta_box( 'sp_columnssdiv', __( 'Table Columns', 'sportspress' ), 'SP_Meta_Box_Team_Columns::output', 'sp_team', 'normal', 'high' );
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* Team Shortcode
|
||||
*
|
||||
* @author ThemeBoy
|
||||
* @category Admin
|
||||
* @package SportsPress/Admin/Meta_Boxes
|
||||
* @version 1.3
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
/**
|
||||
* SP_Meta_Box_Team_Shortcode
|
||||
*/
|
||||
class SP_Meta_Box_Team_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( 'Table Columns', 'sportspress' ); ?></strong>
|
||||
</p>
|
||||
<p><input type="text" value="[team_columns <?php echo $post->ID; ?>]" readonly="readonly" class="wp-ui-text-highlight code"></p>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user