Escape outputs
This commit is contained in:
@@ -4,9 +4,9 @@ class SP_Widget_Birthdays extends WP_Widget {
|
||||
function __construct() {
|
||||
$widget_ops = array(
|
||||
'classname' => 'widget_sportspress widget_birthdays widget_sp_birthdays',
|
||||
'description' => __( 'Display players and staff on their birthday.', 'sportspress' ),
|
||||
'description' => esc_attr__( 'Display players and staff on their birthday.', 'sportspress' ),
|
||||
);
|
||||
parent::__construct( 'sportspress-birthdays', __( 'Birthdays', 'sportspress' ), $widget_ops );
|
||||
parent::__construct( 'sportspress-birthdays', esc_attr__( 'Birthdays', 'sportspress' ), $widget_ops );
|
||||
}
|
||||
|
||||
function widget( $args, $instance ) {
|
||||
@@ -16,10 +16,10 @@ class SP_Widget_Birthdays extends WP_Widget {
|
||||
$birthday_format = empty( $instance['birthday_format'] ) ? 'birthday' : strip_tags( $instance['birthday_format'] );
|
||||
|
||||
do_action( 'sportspress_before_widget', $args, $instance, 'birthdays' );
|
||||
echo $before_widget;
|
||||
echo wp_kses_post( $before_widget );
|
||||
|
||||
if ( $title ) {
|
||||
echo $before_title . $title . $after_title;
|
||||
echo wp_kses_post( $before_title . $title . $after_title );
|
||||
}
|
||||
|
||||
// Action to hook into
|
||||
@@ -36,7 +36,7 @@ class SP_Widget_Birthdays extends WP_Widget {
|
||||
// Action to hook into
|
||||
do_action( 'sportspress_after_widget_template', $args, $instance, 'birthdays' );
|
||||
|
||||
echo $after_widget;
|
||||
echo wp_kses_post( $after_widget );
|
||||
do_action( 'sportspress_after_widget', $args, $instance, 'birthdays' );
|
||||
}
|
||||
|
||||
@@ -64,37 +64,37 @@ class SP_Widget_Birthdays extends WP_Widget {
|
||||
$title = strip_tags( $instance['title'] );
|
||||
$date = strip_tags( $instance['date'] );
|
||||
$options = array(
|
||||
'day' => __( 'Today', 'sportspress' ),
|
||||
'week' => __( 'This week', 'sportspress' ),
|
||||
'month' => __( 'This month', 'sportspress' ),
|
||||
'day' => esc_attr__( 'Today', 'sportspress' ),
|
||||
'week' => esc_attr__( 'This week', 'sportspress' ),
|
||||
'month' => esc_attr__( 'This month', 'sportspress' ),
|
||||
);
|
||||
$birthday_format = strip_tags( $instance['birthday_format'] );
|
||||
$birthday_options = array(
|
||||
'hide' => __( 'Hide', 'sportspress' ),
|
||||
'birthday' => __( 'Birthday', 'sportspress' ),
|
||||
'age' => __( 'Age', 'sportspress' ),
|
||||
'birthdayage' => __( 'Birthday (Age)', 'sportspress' ),
|
||||
'hide' => esc_attr__( 'Hide', 'sportspress' ),
|
||||
'birthday' => esc_attr__( 'Birthday', 'sportspress' ),
|
||||
'age' => esc_attr__( 'Age', 'sportspress' ),
|
||||
'birthdayage' => esc_attr__( 'Birthday (Age)', 'sportspress' ),
|
||||
);
|
||||
|
||||
// Action to hook into
|
||||
do_action( 'sportspress_before_widget_template_form', $this, $instance, 'birthdays' );
|
||||
?>
|
||||
<p><label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', 'sportspress' ); ?></label>
|
||||
<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" /></p>
|
||||
<p><label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php esc_attr_e( 'Title:', 'sportspress' ); ?></label>
|
||||
<input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" /></p>
|
||||
|
||||
<p>
|
||||
<label for="<?php echo $this->get_field_id( 'date' ); ?>"><?php _e( 'Birthday:', 'sportspress' ); ?></label>
|
||||
<select name="<?php echo $this->get_field_name( 'date' ); ?>" id="<?php echo $this->get_field_id( 'date' ); ?>" class="postform widefat">
|
||||
<label for="<?php echo esc_attr( $this->get_field_id( 'date' ) ); ?>"><?php esc_attr_e( 'Birthday:', 'sportspress' ); ?></label>
|
||||
<select name="<?php echo esc_attr( $this->get_field_name( 'date' ) ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'date' ) ); ?>" class="postform widefat">
|
||||
<?php foreach ( $options as $value => $label ) { ?>
|
||||
<option value="<?php echo $value; ?>" <?php selected( $value, $date ); ?>><?php echo $label; ?></option>
|
||||
<option value="<?php echo esc_attr( $value ); ?>" <?php selected( $value, $date ); ?>><?php echo esc_attr( $label ); ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</p>
|
||||
<p>
|
||||
<label for="<?php echo $this->get_field_id( 'birthday_format' ); ?>"><?php _e( 'Format:', 'sportspress' ); ?></label>
|
||||
<select name="<?php echo $this->get_field_name( 'birthday_format' ); ?>" id="<?php echo $this->get_field_id( 'birthday_format' ); ?>" class="postform widefat">
|
||||
<label for="<?php echo esc_attr( $this->get_field_id( 'birthday_format' ) ); ?>"><?php esc_attr_e( 'Format:', 'sportspress' ); ?></label>
|
||||
<select name="<?php echo esc_attr( $this->get_field_name( 'birthday_format' ) ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'birthday_format' ) ); ?>" class="postform widefat">
|
||||
<?php foreach ( $birthday_options as $value => $label ) { ?>
|
||||
<option value="<?php echo $value; ?>" <?php selected( $value, $birthday_format ); ?>><?php echo esc_html( $label ); ?></option>
|
||||
<option value="<?php echo esc_attr( $value ); ?>" <?php selected( $value, $birthday_format ); ?>><?php echo esc_html( $label ); ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</p>
|
||||
|
||||
@@ -4,9 +4,9 @@ class SP_Widget_Countdown extends WP_Widget {
|
||||
function __construct() {
|
||||
$widget_ops = array(
|
||||
'classname' => 'widget_sportspress widget_countdown widget_sp_countdown',
|
||||
'description' => __( 'A clock that counts down to an upcoming event.', 'sportspress' ),
|
||||
'description' => esc_attr__( 'A clock that counts down to an upcoming event.', 'sportspress' ),
|
||||
);
|
||||
parent::__construct( 'sportspress-countdown', __( 'Countdown', 'sportspress' ), $widget_ops );
|
||||
parent::__construct( 'sportspress-countdown', esc_attr__( 'Countdown', 'sportspress' ), $widget_ops );
|
||||
}
|
||||
|
||||
function widget( $args, $instance ) {
|
||||
@@ -25,10 +25,10 @@ class SP_Widget_Countdown extends WP_Widget {
|
||||
$show_status = empty( $instance['show_status'] ) ? false : $instance['show_status'];
|
||||
|
||||
do_action( 'sportspress_before_widget', $args, $instance, 'countdown' );
|
||||
echo $before_widget;
|
||||
echo wp_kses_post( $before_widget );
|
||||
|
||||
if ( $title ) {
|
||||
echo $before_title . $title . $after_title;
|
||||
echo wp_kses_post( $before_title . $title . $after_title );
|
||||
}
|
||||
|
||||
// Action to hook into
|
||||
@@ -54,7 +54,7 @@ class SP_Widget_Countdown extends WP_Widget {
|
||||
// Action to hook into
|
||||
do_action( 'sportspress_after_widget_template', $args, $instance, 'countdown' );
|
||||
|
||||
echo $after_widget;
|
||||
echo wp_kses_post( $after_widget );
|
||||
do_action( 'sportspress_after_widget', $args, $instance, 'countdown' );
|
||||
}
|
||||
|
||||
@@ -113,69 +113,69 @@ class SP_Widget_Countdown extends WP_Widget {
|
||||
// Action to hook into
|
||||
do_action( 'sportspress_before_widget_template_form', $this, $instance, 'countdown' );
|
||||
?>
|
||||
<p><label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', 'sportspress' ); ?></label>
|
||||
<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" /></p>
|
||||
<p><label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php esc_attr_e( 'Title:', 'sportspress' ); ?></label>
|
||||
<input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" /></p>
|
||||
|
||||
<p><label for="<?php echo $this->get_field_id( 'caption' ); ?>"><?php _e( 'Heading:', 'sportspress' ); ?></label>
|
||||
<input class="widefat" id="<?php echo $this->get_field_id( 'caption' ); ?>" name="<?php echo $this->get_field_name( 'caption' ); ?>" type="text" value="<?php echo esc_attr( $caption ); ?>" /></p>
|
||||
<p><label for="<?php echo esc_attr( $this->get_field_id( 'caption' ) ); ?>"><?php esc_attr_e( 'Heading:', 'sportspress' ); ?></label>
|
||||
<input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'caption' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'caption' ) ); ?>" type="text" value="<?php echo esc_attr( $caption ); ?>" /></p>
|
||||
|
||||
<p class="sp-dropdown-filter"><label for="<?php echo $this->get_field_id( 'calendar' ); ?>"><?php printf( __( 'Select %s:', 'sportspress' ), __( 'Calendar', 'sportspress' ) ); ?></label>
|
||||
<p class="sp-dropdown-filter"><label for="<?php echo esc_attr( $this->get_field_id( 'calendar' ) ); ?>"><?php printf( esc_attr__( 'Select %s:', 'sportspress' ), esc_attr__( 'Calendar', 'sportspress' ) ); ?></label>
|
||||
<?php
|
||||
$args = array(
|
||||
'post_type' => 'sp_calendar',
|
||||
'name' => $this->get_field_name( 'calendar' ),
|
||||
'id' => $this->get_field_id( 'calendar' ),
|
||||
'selected' => $calendar,
|
||||
'show_option_all' => __( 'All', 'sportspress' ),
|
||||
'show_option_all' => esc_attr__( 'All', 'sportspress' ),
|
||||
'values' => 'ID',
|
||||
'class' => 'widefat',
|
||||
);
|
||||
if ( ! sp_dropdown_pages( $args ) ) :
|
||||
sp_post_adder( 'sp_calendar', __( 'Add New', 'sportspress' ) );
|
||||
sp_post_adder( 'sp_calendar', esc_attr__( 'Add New', 'sportspress' ) );
|
||||
endif;
|
||||
?>
|
||||
</p>
|
||||
|
||||
<p class="sp-dropdown-filter"><label for="<?php echo $this->get_field_id( 'orderby' ); ?>"><?php printf( __( 'Sort by:', 'sportspress' ) ); ?></label>
|
||||
<select name="<?php echo $this->get_field_name( 'orderby' ); ?>" class="postform widefat">
|
||||
<option value="" <?php selected( 'default', $orderby ); ?>><?php _e( 'Default', 'sportspress' ); ?></option>
|
||||
<option value="date" <?php selected( 'date', $orderby ); ?>><?php _e( 'Date', 'sportspress' ); ?></option>
|
||||
<option value="day" <?php selected( 'day', $orderby ); ?>><?php _e( 'Match Day', 'sportspress' ); ?></option>
|
||||
<p class="sp-dropdown-filter"><label for="<?php echo esc_attr( $this->get_field_id( 'orderby' ) ); ?>"><?php printf( esc_attr__( 'Sort by:', 'sportspress' ) ); ?></label>
|
||||
<select name="<?php echo esc_attr( $this->get_field_name( 'orderby' ) ); ?>" class="postform widefat">
|
||||
<option value="" <?php selected( 'default', $orderby ); ?>><?php esc_attr_e( 'Default', 'sportspress' ); ?></option>
|
||||
<option value="date" <?php selected( 'date', $orderby ); ?>><?php esc_attr_e( 'Date', 'sportspress' ); ?></option>
|
||||
<option value="day" <?php selected( 'day', $orderby ); ?>><?php esc_attr_e( 'Match Day', 'sportspress' ); ?></option>
|
||||
</select>
|
||||
</p>
|
||||
|
||||
<p class="sp-dropdown-filter"><label for="<?php echo $this->get_field_id( 'order' ); ?>"><?php printf( __( 'Sort Order:', 'sportspress' ) ); ?></label>
|
||||
<select name="<?php echo $this->get_field_name( 'order' ); ?>" class="postform widefat">
|
||||
<option value="ASC" <?php selected( 'ASC', $order ); ?>><?php _e( 'Ascending', 'sportspress' ); ?></option>
|
||||
<option value="DESC" <?php selected( 'DESC', $order ); ?>><?php _e( 'Descending', 'sportspress' ); ?></option>
|
||||
<p class="sp-dropdown-filter"><label for="<?php echo esc_attr( $this->get_field_id( 'order' ) ); ?>"><?php printf( esc_attr__( 'Sort Order:', 'sportspress' ) ); ?></label>
|
||||
<select name="<?php echo esc_attr( $this->get_field_name( 'order' ) ); ?>" class="postform widefat">
|
||||
<option value="ASC" <?php selected( 'ASC', $order ); ?>><?php esc_attr_e( 'Ascending', 'sportspress' ); ?></option>
|
||||
<option value="DESC" <?php selected( 'DESC', $order ); ?>><?php esc_attr_e( 'Descending', 'sportspress' ); ?></option>
|
||||
</select>
|
||||
</p>
|
||||
|
||||
<p class="sp-dropdown-filter"><label for="<?php echo $this->get_field_id( 'team' ); ?>"><?php printf( __( 'Select %s:', 'sportspress' ), __( 'Team', 'sportspress' ) ); ?></label>
|
||||
<p class="sp-dropdown-filter"><label for="<?php echo esc_attr( $this->get_field_id( 'team' ) ); ?>"><?php printf( esc_attr__( 'Select %s:', 'sportspress' ), esc_attr__( 'Team', 'sportspress' ) ); ?></label>
|
||||
<?php
|
||||
$args = array(
|
||||
'post_type' => 'sp_team',
|
||||
'name' => $this->get_field_name( 'team' ),
|
||||
'id' => $this->get_field_id( 'team' ),
|
||||
'selected' => $team,
|
||||
'show_option_all' => __( 'All', 'sportspress' ),
|
||||
'show_option_all' => esc_attr__( 'All', 'sportspress' ),
|
||||
'values' => 'ID',
|
||||
'class' => 'widefat',
|
||||
);
|
||||
if ( ! sp_dropdown_pages( $args ) ) :
|
||||
sp_post_adder( 'sp_team', __( 'Add New', 'sportspress' ) );
|
||||
sp_post_adder( 'sp_team', esc_attr__( 'Add New', 'sportspress' ) );
|
||||
endif;
|
||||
?>
|
||||
</p>
|
||||
|
||||
<p class="sp-dropdown-target"><label for="<?php echo $this->get_field_id( 'id' ); ?>"><?php printf( __( 'Select %s:', 'sportspress' ), __( 'Event', 'sportspress' ) ); ?></label>
|
||||
<p class="sp-dropdown-target"><label for="<?php echo esc_attr( $this->get_field_id( 'id' ) ); ?>"><?php printf( esc_attr__( 'Select %s:', 'sportspress' ), esc_attr__( 'Event', 'sportspress' ) ); ?></label>
|
||||
<?php
|
||||
$args = array(
|
||||
'post_type' => 'sp_event',
|
||||
'name' => $this->get_field_name( 'id' ),
|
||||
'id' => $this->get_field_id( 'id' ),
|
||||
'selected' => $id,
|
||||
'show_option_all' => __( '(Auto)', 'sportspress' ),
|
||||
'show_option_all' => esc_attr__( '(Auto)', 'sportspress' ),
|
||||
'values' => 'ID',
|
||||
'class' => 'widefat',
|
||||
'show_dates' => true,
|
||||
@@ -183,25 +183,25 @@ class SP_Widget_Countdown extends WP_Widget {
|
||||
'filter' => 'sp_team',
|
||||
);
|
||||
if ( ! sp_dropdown_pages( $args ) ) :
|
||||
sp_post_adder( 'sp_event', __( 'Add New', 'sportspress' ) );
|
||||
sp_post_adder( 'sp_event', esc_attr__( 'Add New', 'sportspress' ) );
|
||||
endif;
|
||||
?>
|
||||
</p>
|
||||
|
||||
<p><input class="checkbox" type="checkbox" id="<?php echo $this->get_field_id( 'show_venue' ); ?>" name="<?php echo $this->get_field_name( 'show_venue' ); ?>" value="1" <?php checked( $show_venue, 1 ); ?>>
|
||||
<label for="<?php echo $this->get_field_id( 'show_venue' ); ?>"><?php _e( 'Display venue', 'sportspress' ); ?></label></p>
|
||||
<p><input class="checkbox" type="checkbox" id="<?php echo esc_attr( $this->get_field_id( 'show_venue' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'show_venue' ) ); ?>" value="1" <?php checked( $show_venue, 1 ); ?>>
|
||||
<label for="<?php echo esc_attr( $this->get_field_id( 'show_venue' ) ); ?>"><?php esc_attr_e( 'Display venue', 'sportspress' ); ?></label></p>
|
||||
|
||||
<p><input class="checkbox" type="checkbox" id="<?php echo $this->get_field_id( 'show_league' ); ?>" name="<?php echo $this->get_field_name( 'show_league' ); ?>" value="1" <?php checked( $show_league, 1 ); ?>>
|
||||
<label for="<?php echo $this->get_field_id( 'show_league' ); ?>"><?php _e( 'Display league', 'sportspress' ); ?></label></p>
|
||||
<p><input class="checkbox" type="checkbox" id="<?php echo esc_attr( $this->get_field_id( 'show_league' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'show_league' ) ); ?>" value="1" <?php checked( $show_league, 1 ); ?>>
|
||||
<label for="<?php echo esc_attr( $this->get_field_id( 'show_league' ) ); ?>"><?php esc_attr_e( 'Display league', 'sportspress' ); ?></label></p>
|
||||
|
||||
<p><input class="checkbox" type="checkbox" id="<?php echo $this->get_field_id( 'show_date' ); ?>" name="<?php echo $this->get_field_name( 'show_date' ); ?>" value="1" <?php checked( $show_date, 1 ); ?>>
|
||||
<label for="<?php echo $this->get_field_id( 'show_date' ); ?>"><?php _e( 'Display date', 'sportspress' ); ?></label></p>
|
||||
<p><input class="checkbox" type="checkbox" id="<?php echo esc_attr( $this->get_field_id( 'show_date' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'show_date' ) ); ?>" value="1" <?php checked( $show_date, 1 ); ?>>
|
||||
<label for="<?php echo esc_attr( $this->get_field_id( 'show_date' ) ); ?>"><?php esc_attr_e( 'Display date', 'sportspress' ); ?></label></p>
|
||||
|
||||
<p><input class="checkbox" type="checkbox" id="<?php echo $this->get_field_id( 'show_excluded' ); ?>" name="<?php echo $this->get_field_name( 'show_excluded' ); ?>" value="1" <?php checked( $show_excluded, 1 ); ?>>
|
||||
<label for="<?php echo $this->get_field_id( 'show_excluded' ); ?>"><?php _e( 'Display excluded events', 'sportspress' ); ?></label></p>
|
||||
<p><input class="checkbox" type="checkbox" id="<?php echo esc_attr( $this->get_field_id( 'show_excluded' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'show_excluded' ) ); ?>" value="1" <?php checked( $show_excluded, 1 ); ?>>
|
||||
<label for="<?php echo esc_attr( $this->get_field_id( 'show_excluded' ) ); ?>"><?php esc_attr_e( 'Display excluded events', 'sportspress' ); ?></label></p>
|
||||
|
||||
<p><input class="checkbox" type="checkbox" id="<?php echo $this->get_field_id( 'show_status' ); ?>" name="<?php echo $this->get_field_name( 'show_status' ); ?>" value="1" <?php checked( $show_status, 1 ); ?>>
|
||||
<label for="<?php echo $this->get_field_id( 'show_status' ); ?>"><?php _e( 'Display event status', 'sportspress' ); ?></label></p>
|
||||
<p><input class="checkbox" type="checkbox" id="<?php echo esc_attr( $this->get_field_id( 'show_status' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'show_status' ) ); ?>" value="1" <?php checked( $show_status, 1 ); ?>>
|
||||
<label for="<?php echo esc_attr( $this->get_field_id( 'show_status' ) ); ?>"><?php esc_attr_e( 'Display event status', 'sportspress' ); ?></label></p>
|
||||
|
||||
<?php
|
||||
// Action to hook into
|
||||
|
||||
@@ -4,9 +4,9 @@ class SP_Widget_Event_Blocks extends WP_Widget {
|
||||
function __construct() {
|
||||
$widget_ops = array(
|
||||
'classname' => 'widget_sportspress widget_sp_event_blocks',
|
||||
'description' => __( 'A list of events.', 'sportspress' ),
|
||||
'description' => esc_attr__( 'A list of events.', 'sportspress' ),
|
||||
);
|
||||
parent::__construct( 'sportspress-event-blocks', __( 'Event Blocks', 'sportspress' ), $widget_ops );
|
||||
parent::__construct( 'sportspress-event-blocks', esc_attr__( 'Event Blocks', 'sportspress' ), $widget_ops );
|
||||
}
|
||||
|
||||
function widget( $args, $instance ) {
|
||||
@@ -35,10 +35,10 @@ class SP_Widget_Event_Blocks extends WP_Widget {
|
||||
$show_all_events_link = empty( $instance['show_all_events_link'] ) ? false : $instance['show_all_events_link'];
|
||||
|
||||
do_action( 'sportspress_before_widget', $args, $instance, 'event-blocks' );
|
||||
echo $before_widget;
|
||||
echo wp_kses_post( $before_widget );
|
||||
|
||||
if ( $title ) {
|
||||
echo $before_title . $title . $after_title;
|
||||
echo wp_kses_post( $before_title . $title . $after_title );
|
||||
}
|
||||
|
||||
// Action to hook into
|
||||
@@ -66,7 +66,7 @@ class SP_Widget_Event_Blocks extends WP_Widget {
|
||||
// Action to hook into
|
||||
do_action( 'sportspress_after_widget_template', $args, $instance, 'event-blocks' );
|
||||
|
||||
echo $after_widget;
|
||||
echo wp_kses_post( $after_widget );
|
||||
do_action( 'sportspress_after_widget', $args, $instance, 'event-blocks' );
|
||||
}
|
||||
|
||||
@@ -131,17 +131,17 @@ class SP_Widget_Event_Blocks extends WP_Widget {
|
||||
// Action to hook into
|
||||
do_action( 'sportspress_before_widget_template_form', $this, $instance, 'event-blocks' );
|
||||
?>
|
||||
<p><label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', 'sportspress' ); ?></label>
|
||||
<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" /></p>
|
||||
<p><label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php esc_attr_e( 'Title:', 'sportspress' ); ?></label>
|
||||
<input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" /></p>
|
||||
|
||||
<p><label for="<?php echo $this->get_field_id( 'caption' ); ?>"><?php _e( 'Heading:', 'sportspress' ); ?></label>
|
||||
<input class="widefat" id="<?php echo $this->get_field_id( 'caption' ); ?>" name="<?php echo $this->get_field_name( 'caption' ); ?>" type="text" value="<?php echo esc_attr( $caption ); ?>" /></p>
|
||||
<p><label for="<?php echo esc_attr( $this->get_field_id( 'caption' ) ); ?>"><?php esc_attr_e( 'Heading:', 'sportspress' ); ?></label>
|
||||
<input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'caption' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'caption' ) ); ?>" type="text" value="<?php echo esc_attr( $caption ); ?>" /></p>
|
||||
|
||||
<p><label for="<?php echo $this->get_field_id( 'id' ); ?>"><?php printf( __( 'Select %s:', 'sportspress' ), __( 'Calendar', 'sportspress' ) ); ?></label>
|
||||
<p><label for="<?php echo esc_attr( $this->get_field_id( 'id' ) ); ?>"><?php printf( esc_attr__( 'Select %s:', 'sportspress' ), esc_attr__( 'Calendar', 'sportspress' ) ); ?></label>
|
||||
<?php
|
||||
$args = array(
|
||||
'post_type' => 'sp_calendar',
|
||||
'show_option_all' => __( 'All', 'sportspress' ),
|
||||
'show_option_all' => esc_attr__( 'All', 'sportspress' ),
|
||||
'name' => $this->get_field_name( 'id' ),
|
||||
'id' => $this->get_field_id( 'id' ),
|
||||
'selected' => $id,
|
||||
@@ -149,15 +149,15 @@ class SP_Widget_Event_Blocks extends WP_Widget {
|
||||
'class' => 'sp-event-calendar-select widefat',
|
||||
);
|
||||
if ( ! sp_dropdown_pages( $args ) ) :
|
||||
sp_post_adder( 'sp_calendar', __( 'Add New', 'sportspress' ) );
|
||||
sp_post_adder( 'sp_calendar', esc_attr__( 'Add New', 'sportspress' ) );
|
||||
endif;
|
||||
?>
|
||||
</p>
|
||||
|
||||
<p><label for="<?php echo $this->get_field_id( 'status' ); ?>"><?php _e( 'Status:', 'sportspress' ); ?></label>
|
||||
<p><label for="<?php echo esc_attr( $this->get_field_id( 'status' ) ); ?>"><?php esc_attr_e( 'Status:', 'sportspress' ); ?></label>
|
||||
<?php
|
||||
$args = array(
|
||||
'show_option_default' => __( 'Default', 'sportspress' ),
|
||||
'show_option_default' => esc_attr__( 'Default', 'sportspress' ),
|
||||
'name' => $this->get_field_name( 'status' ),
|
||||
'id' => $this->get_field_id( 'status' ),
|
||||
'selected' => $status,
|
||||
@@ -168,10 +168,10 @@ class SP_Widget_Event_Blocks extends WP_Widget {
|
||||
</p>
|
||||
|
||||
<div class="sp-date-selector">
|
||||
<p><label for="<?php echo $this->get_field_id( 'date' ); ?>"><?php _e( 'Date:', 'sportspress' ); ?></label>
|
||||
<p><label for="<?php echo esc_attr( $this->get_field_id( 'date' ) ); ?>"><?php esc_attr_e( 'Date:', 'sportspress' ); ?></label>
|
||||
<?php
|
||||
$args = array(
|
||||
'show_option_default' => __( 'Default', 'sportspress' ),
|
||||
'show_option_default' => esc_attr__( 'Default', 'sportspress' ),
|
||||
'name' => $this->get_field_name( 'date' ),
|
||||
'id' => $this->get_field_id( 'date' ),
|
||||
'selected' => $date,
|
||||
@@ -190,9 +190,9 @@ class SP_Widget_Event_Blocks extends WP_Widget {
|
||||
if ( $date_relative ) :
|
||||
?>
|
||||
hidden<?php endif; ?>">
|
||||
<input type="text" name="<?php echo $this->get_field_name( 'date_from' ); ?>" value="<?php echo $date_from; ?>" placeholder="yyyy-mm-dd" size="10">
|
||||
<input type="text" name="<?php echo esc_attr( $this->get_field_name( 'date_from' ) ); ?>" value="<?php echo esc_attr( $date_from ); ?>" placeholder="yyyy-mm-dd" size="10">
|
||||
:
|
||||
<input type="text" name="<?php echo $this->get_field_name( 'date_to' ); ?>" value="<?php echo $date_to; ?>" placeholder="yyyy-mm-dd" size="10">
|
||||
<input type="text" name="<?php echo esc_attr( $this->get_field_name( 'date_to' ) ); ?>" value="<?php echo esc_attr( $date_to ); ?>" placeholder="yyyy-mm-dd" size="10">
|
||||
</p>
|
||||
|
||||
<p class="sp-date-range-relative
|
||||
@@ -200,42 +200,42 @@ class SP_Widget_Event_Blocks extends WP_Widget {
|
||||
if ( ! $date_relative ) :
|
||||
?>
|
||||
hidden<?php endif; ?>">
|
||||
<?php _e( 'Past', 'sportspress' ); ?>
|
||||
<input type="number" min="0" step="1" class="tiny-text" name="<?php echo $this->get_field_name( 'date_past' ); ?>" value="<?php echo $date_past; ?>">
|
||||
<?php esc_attr_e( 'Past', 'sportspress' ); ?>
|
||||
<input type="number" min="0" step="1" class="tiny-text" name="<?php echo esc_attr( $this->get_field_name( 'date_past' ) ); ?>" value="<?php echo esc_attr( $date_past ); ?>">
|
||||
→
|
||||
<?php _e( 'Next', 'sportspress' ); ?>
|
||||
<input type="number" min="0" step="1" class="tiny-text" name="<?php echo $this->get_field_name( 'date_future' ); ?>" value="<?php echo $date_future; ?>">
|
||||
<?php _e( 'days', 'sportspress' ); ?>
|
||||
<?php esc_attr_e( 'Next', 'sportspress' ); ?>
|
||||
<input type="number" min="0" step="1" class="tiny-text" name="<?php echo esc_attr( $this->get_field_name( 'date_future' ) ); ?>" value="<?php echo esc_attr( $date_future ); ?>">
|
||||
<?php esc_attr_e( 'days', 'sportspress' ); ?>
|
||||
</p>
|
||||
|
||||
<p class="sp-date-relative">
|
||||
<label>
|
||||
<input type="checkbox" name="<?php echo $this->get_field_name( 'date_relative' ); ?>" value="1" id="<?php echo $this->get_field_id( 'date_relative' ); ?>" <?php checked( $date_relative ); ?>>
|
||||
<?php _e( 'Relative', 'sportspress' ); ?>
|
||||
<input type="checkbox" name="<?php echo esc_attr( $this->get_field_name( 'date_relative' ) ); ?>" value="1" id="<?php echo esc_attr( $this->get_field_id( 'date_relative' ) ); ?>" <?php checked( $date_relative ); ?>>
|
||||
<?php esc_attr_e( 'Relative', 'sportspress' ); ?>
|
||||
</label>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p><label for="<?php echo $this->get_field_id( 'day' ); ?>"><?php _e( 'Match Day:', 'sportspress' ); ?></label>
|
||||
<input id="<?php echo $this->get_field_id( 'day' ); ?>" name="<?php echo $this->get_field_name( 'day' ); ?>" type="text" placeholder="<?php _e( 'All', 'sportspress' ); ?>" value="<?php echo esc_attr( $day ); ?>" size="10"></p>
|
||||
<p><label for="<?php echo esc_attr( $this->get_field_id( 'day' ) ); ?>"><?php esc_attr_e( 'Match Day:', 'sportspress' ); ?></label>
|
||||
<input id="<?php echo esc_attr( $this->get_field_id( 'day' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'day' ) ); ?>" type="text" placeholder="<?php esc_attr_e( 'All', 'sportspress' ); ?>" value="<?php echo esc_attr( $day ); ?>" size="10"></p>
|
||||
|
||||
<p><label for="<?php echo $this->get_field_id( 'number' ); ?>"><?php _e( 'Number of events to show:', 'sportspress' ); ?></label>
|
||||
<input id="<?php echo $this->get_field_id( 'number' ); ?>" name="<?php echo $this->get_field_name( 'number' ); ?>" type="text" value="<?php echo esc_attr( $number ); ?>" size="3"></p>
|
||||
<p><label for="<?php echo esc_attr( $this->get_field_id( 'number' ) ); ?>"><?php esc_attr_e( 'Number of events to show:', 'sportspress' ); ?></label>
|
||||
<input id="<?php echo esc_attr( $this->get_field_id( 'number' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'number' ) ); ?>" type="text" value="<?php echo esc_attr( $number ); ?>" size="3"></p>
|
||||
|
||||
<p><label for="<?php echo $this->get_field_id( 'order' ); ?>"><?php _e( 'Sort Order:', 'sportspress' ); ?></label>
|
||||
<select name="<?php echo $this->get_field_name( 'order' ); ?>" id="<?php echo $this->get_field_id( 'order' ); ?>" class="sp-select-order widefat">
|
||||
<option value="default" <?php selected( 'default', $order ); ?>><?php _e( 'Default', 'sportspress' ); ?></option>
|
||||
<option value="ASC" <?php selected( 'ASC', $order ); ?>><?php _e( 'Ascending', 'sportspress' ); ?></option>
|
||||
<option value="DESC" <?php selected( 'DESC', $order ); ?>><?php _e( 'Descending', 'sportspress' ); ?></option>
|
||||
<p><label for="<?php echo esc_attr( $this->get_field_id( 'order' ) ); ?>"><?php esc_attr_e( 'Sort Order:', 'sportspress' ); ?></label>
|
||||
<select name="<?php echo esc_attr( $this->get_field_name( 'order' ) ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'order' ) ); ?>" class="sp-select-order widefat">
|
||||
<option value="default" <?php selected( 'default', $order ); ?>><?php esc_attr_e( 'Default', 'sportspress' ); ?></option>
|
||||
<option value="ASC" <?php selected( 'ASC', $order ); ?>><?php esc_attr_e( 'Ascending', 'sportspress' ); ?></option>
|
||||
<option value="DESC" <?php selected( 'DESC', $order ); ?>><?php esc_attr_e( 'Descending', 'sportspress' ); ?></option>
|
||||
</select></p>
|
||||
|
||||
<p class="sp-event-calendar-show-all-toggle
|
||||
<?php
|
||||
if ( ! $id ) :
|
||||
?>
|
||||
hidden<?php endif; ?>"><input class="checkbox" type="checkbox" id="<?php echo $this->get_field_id( 'show_all_events_link' ); ?>" name="<?php echo $this->get_field_name( 'show_all_events_link' ); ?>" value="1" <?php checked( $show_all_events_link, 1 ); ?>>
|
||||
<label for="<?php echo $this->get_field_id( 'show_all_events_link' ); ?>"><?php _e( 'Display link to view all events', 'sportspress' ); ?></label></p>
|
||||
hidden<?php endif; ?>"><input class="checkbox" type="checkbox" id="<?php echo esc_attr( $this->get_field_id( 'show_all_events_link' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'show_all_events_link' ) ); ?>" value="1" <?php checked( $show_all_events_link, 1 ); ?>>
|
||||
<label for="<?php echo esc_attr( $this->get_field_id( 'show_all_events_link' ) ); ?>"><?php esc_attr_e( 'Display link to view all events', 'sportspress' ); ?></label></p>
|
||||
|
||||
<?php
|
||||
// Action to hook into
|
||||
|
||||
@@ -4,9 +4,9 @@ class SP_Widget_Event_Calendar extends WP_Widget {
|
||||
function __construct() {
|
||||
$widget_ops = array(
|
||||
'classname' => 'widget_sportspress widget_calendar widget_sp_event_calendar',
|
||||
'description' => __( 'A calendar of events.', 'sportspress' ),
|
||||
'description' => esc_attr__( 'A calendar of events.', 'sportspress' ),
|
||||
);
|
||||
parent::__construct( 'sportspress-event-calendar', __( 'Event Calendar', 'sportspress' ), $widget_ops );
|
||||
parent::__construct( 'sportspress-event-calendar', esc_attr__( 'Event Calendar', 'sportspress' ), $widget_ops );
|
||||
}
|
||||
|
||||
function widget( $args, $instance ) {
|
||||
@@ -32,10 +32,10 @@ class SP_Widget_Event_Calendar extends WP_Widget {
|
||||
$show_all_events_link = empty( $instance['show_all_events_link'] ) ? false : $instance['show_all_events_link'];
|
||||
|
||||
do_action( 'sportspress_before_widget', $args, $instance, 'event-calendar' );
|
||||
echo $before_widget;
|
||||
echo wp_kses_post( $before_widget );
|
||||
|
||||
if ( $title ) {
|
||||
echo $before_title . $title . $after_title;
|
||||
echo wp_kses_post( $before_title . $title . $after_title );
|
||||
}
|
||||
|
||||
// Action to hook into
|
||||
@@ -61,7 +61,7 @@ class SP_Widget_Event_Calendar extends WP_Widget {
|
||||
// Action to hook into
|
||||
do_action( 'sportspress_after_widget_template', $args, $instance, 'event-calendar' );
|
||||
|
||||
echo $after_widget;
|
||||
echo wp_kses_post( $after_widget );
|
||||
do_action( 'sportspress_after_widget', $args, $instance, 'event-calendar' );
|
||||
}
|
||||
|
||||
@@ -117,14 +117,14 @@ class SP_Widget_Event_Calendar extends WP_Widget {
|
||||
// Action to hook into
|
||||
do_action( 'sportspress_before_widget_template_form', $this, $instance, 'event-calendar' );
|
||||
?>
|
||||
<p><label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', 'sportspress' ); ?></label>
|
||||
<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" /></p>
|
||||
<p><label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php esc_attr_e( 'Title:', 'sportspress' ); ?></label>
|
||||
<input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" /></p>
|
||||
|
||||
<p><label for="<?php echo $this->get_field_id( 'id' ); ?>"><?php printf( __( 'Select %s:', 'sportspress' ), __( 'Calendar', 'sportspress' ) ); ?></label>
|
||||
<p><label for="<?php echo esc_attr( $this->get_field_id( 'id' ) ); ?>"><?php printf( esc_attr__( 'Select %s:', 'sportspress' ), esc_attr__( 'Calendar', 'sportspress' ) ); ?></label>
|
||||
<?php
|
||||
$args = array(
|
||||
'post_type' => 'sp_calendar',
|
||||
'show_option_all' => __( 'All', 'sportspress' ),
|
||||
'show_option_all' => esc_attr__( 'All', 'sportspress' ),
|
||||
'name' => $this->get_field_name( 'id' ),
|
||||
'id' => $this->get_field_id( 'id' ),
|
||||
'selected' => $id,
|
||||
@@ -132,15 +132,15 @@ class SP_Widget_Event_Calendar extends WP_Widget {
|
||||
'class' => 'sp-event-calendar-select widefat',
|
||||
);
|
||||
if ( ! sp_dropdown_pages( $args ) ) :
|
||||
sp_post_adder( 'sp_calendar', __( 'Add New', 'sportspress' ) );
|
||||
sp_post_adder( 'sp_calendar', esc_attr__( 'Add New', 'sportspress' ) );
|
||||
endif;
|
||||
?>
|
||||
</p>
|
||||
|
||||
<p><label for="<?php echo $this->get_field_id( 'status' ); ?>"><?php _e( 'Status:', 'sportspress' ); ?></label>
|
||||
<p><label for="<?php echo esc_attr( $this->get_field_id( 'status' ) ); ?>"><?php esc_attr_e( 'Status:', 'sportspress' ); ?></label>
|
||||
<?php
|
||||
$args = array(
|
||||
'show_option_default' => __( 'Default', 'sportspress' ),
|
||||
'show_option_default' => esc_attr__( 'Default', 'sportspress' ),
|
||||
'name' => $this->get_field_name( 'status' ),
|
||||
'id' => $this->get_field_id( 'status' ),
|
||||
'selected' => $status,
|
||||
@@ -151,10 +151,10 @@ class SP_Widget_Event_Calendar extends WP_Widget {
|
||||
</p>
|
||||
|
||||
<div class="sp-date-selector">
|
||||
<p><label for="<?php echo $this->get_field_id( 'date' ); ?>"><?php _e( 'Date:', 'sportspress' ); ?></label>
|
||||
<p><label for="<?php echo esc_attr( $this->get_field_id( 'date' ) ); ?>"><?php esc_attr_e( 'Date:', 'sportspress' ); ?></label>
|
||||
<?php
|
||||
$args = array(
|
||||
'show_option_default' => __( 'Default', 'sportspress' ),
|
||||
'show_option_default' => esc_attr__( 'Default', 'sportspress' ),
|
||||
'name' => $this->get_field_name( 'date' ),
|
||||
'id' => $this->get_field_id( 'date' ),
|
||||
'selected' => $date,
|
||||
@@ -173,9 +173,9 @@ class SP_Widget_Event_Calendar extends WP_Widget {
|
||||
if ( $date_relative ) :
|
||||
?>
|
||||
hidden<?php endif; ?>">
|
||||
<input type="text" name="<?php echo $this->get_field_name( 'date_from' ); ?>" value="<?php echo $date_from; ?>" placeholder="yyyy-mm-dd" size="10">
|
||||
<input type="text" name="<?php echo esc_attr( $this->get_field_name( 'date_from' ) ); ?>" value="<?php echo esc_attr( $date_from ); ?>" placeholder="yyyy-mm-dd" size="10">
|
||||
:
|
||||
<input type="text" name="<?php echo $this->get_field_name( 'date_to' ); ?>" value="<?php echo $date_to; ?>" placeholder="yyyy-mm-dd" size="10">
|
||||
<input type="text" name="<?php echo esc_attr( $this->get_field_name( 'date_to' ) ); ?>" value="<?php echo esc_attr( $date_to ); ?>" placeholder="yyyy-mm-dd" size="10">
|
||||
</p>
|
||||
|
||||
<p class="sp-date-range-relative
|
||||
@@ -183,32 +183,32 @@ class SP_Widget_Event_Calendar extends WP_Widget {
|
||||
if ( ! $date_relative ) :
|
||||
?>
|
||||
hidden<?php endif; ?>">
|
||||
<?php _e( 'Past', 'sportspress' ); ?>
|
||||
<input type="number" min="0" step="1" class="tiny-text" name="<?php echo $this->get_field_name( 'date_past' ); ?>" value="<?php echo $date_past; ?>">
|
||||
<?php esc_attr_e( 'Past', 'sportspress' ); ?>
|
||||
<input type="number" min="0" step="1" class="tiny-text" name="<?php echo esc_attr( $this->get_field_name( 'date_past' ) ); ?>" value="<?php echo esc_attr( $date_past ); ?>">
|
||||
→
|
||||
<?php _e( 'Next', 'sportspress' ); ?>
|
||||
<input type="number" min="0" step="1" class="tiny-text" name="<?php echo $this->get_field_name( 'date_future' ); ?>" value="<?php echo $date_future; ?>">
|
||||
<?php _e( 'days', 'sportspress' ); ?>
|
||||
<?php esc_attr_e( 'Next', 'sportspress' ); ?>
|
||||
<input type="number" min="0" step="1" class="tiny-text" name="<?php echo esc_attr( $this->get_field_name( 'date_future' ) ); ?>" value="<?php echo esc_attr( $date_future ); ?>">
|
||||
<?php esc_attr_e( 'days', 'sportspress' ); ?>
|
||||
</p>
|
||||
|
||||
<p class="sp-date-relative">
|
||||
<label>
|
||||
<input type="checkbox" name="<?php echo $this->get_field_name( 'date_relative' ); ?>" value="1" id="<?php echo $this->get_field_id( 'date_relative' ); ?>" <?php checked( $date_relative ); ?>>
|
||||
<?php _e( 'Relative', 'sportspress' ); ?>
|
||||
<input type="checkbox" name="<?php echo esc_attr( $this->get_field_name( 'date_relative' ) ); ?>" value="1" id="<?php echo esc_attr( $this->get_field_id( 'date_relative' ) ); ?>" <?php checked( $date_relative ); ?>>
|
||||
<?php esc_attr_e( 'Relative', 'sportspress' ); ?>
|
||||
</label>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p><label for="<?php echo $this->get_field_id( 'day' ); ?>"><?php _e( 'Match Day:', 'sportspress' ); ?></label>
|
||||
<input id="<?php echo $this->get_field_id( 'day' ); ?>" name="<?php echo $this->get_field_name( 'day' ); ?>" type="text" placeholder="<?php _e( 'All', 'sportspress' ); ?>" value="<?php echo esc_attr( $day ); ?>" size="10"></p>
|
||||
<p><label for="<?php echo esc_attr( $this->get_field_id( 'day' ) ); ?>"><?php esc_attr_e( 'Match Day:', 'sportspress' ); ?></label>
|
||||
<input id="<?php echo esc_attr( $this->get_field_id( 'day' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'day' ) ); ?>" type="text" placeholder="<?php esc_attr_e( 'All', 'sportspress' ); ?>" value="<?php echo esc_attr( $day ); ?>" size="10"></p>
|
||||
|
||||
<p class="sp-event-calendar-show-all-toggle
|
||||
<?php
|
||||
if ( ! $id ) :
|
||||
?>
|
||||
hidden<?php endif; ?>"><input class="checkbox" type="checkbox" id="<?php echo $this->get_field_id( 'show_all_events_link' ); ?>" name="<?php echo $this->get_field_name( 'show_all_events_link' ); ?>" value="1" <?php checked( $show_all_events_link, 1 ); ?>>
|
||||
<label for="<?php echo $this->get_field_id( 'show_all_events_link' ); ?>"><?php _e( 'Display link to view all events', 'sportspress' ); ?></label></p>
|
||||
hidden<?php endif; ?>"><input class="checkbox" type="checkbox" id="<?php echo esc_attr( $this->get_field_id( 'show_all_events_link' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'show_all_events_link' ) ); ?>" value="1" <?php checked( $show_all_events_link, 1 ); ?>>
|
||||
<label for="<?php echo esc_attr( $this->get_field_id( 'show_all_events_link' ) ); ?>"><?php esc_attr_e( 'Display link to view all events', 'sportspress' ); ?></label></p>
|
||||
|
||||
<?php
|
||||
// Action to hook into
|
||||
|
||||
@@ -4,9 +4,9 @@ class SP_Widget_Event_List extends WP_Widget {
|
||||
function __construct() {
|
||||
$widget_ops = array(
|
||||
'classname' => 'widget_sportspress widget_sp_event_list',
|
||||
'description' => __( 'A list of events.', 'sportspress' ),
|
||||
'description' => esc_attr__( 'A list of events.', 'sportspress' ),
|
||||
);
|
||||
parent::__construct( 'sportspress-event-list', __( 'Event List', 'sportspress' ), $widget_ops );
|
||||
parent::__construct( 'sportspress-event-list', esc_attr__( 'Event List', 'sportspress' ), $widget_ops );
|
||||
}
|
||||
|
||||
function widget( $args, $instance ) {
|
||||
@@ -36,10 +36,10 @@ class SP_Widget_Event_List extends WP_Widget {
|
||||
$show_all_events_link = empty( $instance['show_all_events_link'] ) ? false : $instance['show_all_events_link'];
|
||||
|
||||
do_action( 'sportspress_before_widget', $args, $instance, 'event-list' );
|
||||
echo $before_widget;
|
||||
echo wp_kses_post( $before_widget );
|
||||
|
||||
if ( $title ) {
|
||||
echo $before_title . $title . $after_title;
|
||||
echo wp_kses_post( $before_title . $title . $after_title );
|
||||
}
|
||||
|
||||
// Action to hook into
|
||||
@@ -68,7 +68,7 @@ class SP_Widget_Event_List extends WP_Widget {
|
||||
// Action to hook into
|
||||
do_action( 'sportspress_after_widget_template', $args, $instance, 'event-list' );
|
||||
|
||||
echo $after_widget;
|
||||
echo wp_kses_post( $after_widget );
|
||||
do_action( 'sportspress_after_widget', $args, $instance, 'event-list' );
|
||||
}
|
||||
|
||||
@@ -138,17 +138,17 @@ class SP_Widget_Event_List extends WP_Widget {
|
||||
// Action to hook into
|
||||
do_action( 'sportspress_before_widget_template_form', $this, $instance, 'event-list' );
|
||||
?>
|
||||
<p><label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', 'sportspress' ); ?></label>
|
||||
<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" /></p>
|
||||
<p><label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php esc_attr_e( 'Title:', 'sportspress' ); ?></label>
|
||||
<input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" /></p>
|
||||
|
||||
<p><label for="<?php echo $this->get_field_id( 'caption' ); ?>"><?php _e( 'Heading:', 'sportspress' ); ?></label>
|
||||
<input class="widefat" id="<?php echo $this->get_field_id( 'caption' ); ?>" name="<?php echo $this->get_field_name( 'caption' ); ?>" type="text" value="<?php echo esc_attr( $caption ); ?>" /></p>
|
||||
<p><label for="<?php echo esc_attr( $this->get_field_id( 'caption' ) ); ?>"><?php esc_attr_e( 'Heading:', 'sportspress' ); ?></label>
|
||||
<input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'caption' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'caption' ) ); ?>" type="text" value="<?php echo esc_attr( $caption ); ?>" /></p>
|
||||
|
||||
<p><label for="<?php echo $this->get_field_id( 'id' ); ?>"><?php printf( __( 'Select %s:', 'sportspress' ), __( 'Calendar', 'sportspress' ) ); ?></label>
|
||||
<p><label for="<?php echo esc_attr( $this->get_field_id( 'id' ) ); ?>"><?php printf( esc_attr__( 'Select %s:', 'sportspress' ), esc_attr__( 'Calendar', 'sportspress' ) ); ?></label>
|
||||
<?php
|
||||
$args = array(
|
||||
'post_type' => 'sp_calendar',
|
||||
'show_option_all' => __( 'All', 'sportspress' ),
|
||||
'show_option_all' => esc_attr__( 'All', 'sportspress' ),
|
||||
'name' => $this->get_field_name( 'id' ),
|
||||
'id' => $this->get_field_id( 'id' ),
|
||||
'selected' => $id,
|
||||
@@ -156,15 +156,15 @@ class SP_Widget_Event_List extends WP_Widget {
|
||||
'class' => 'sp-event-calendar-select widefat',
|
||||
);
|
||||
if ( ! sp_dropdown_pages( $args ) ) :
|
||||
sp_post_adder( 'sp_calendar', __( 'Add New', 'sportspress' ) );
|
||||
sp_post_adder( 'sp_calendar', esc_attr__( 'Add New', 'sportspress' ) );
|
||||
endif;
|
||||
?>
|
||||
</p>
|
||||
|
||||
<p><label for="<?php echo $this->get_field_id( 'status' ); ?>"><?php _e( 'Status:', 'sportspress' ); ?></label>
|
||||
<p><label for="<?php echo esc_attr( $this->get_field_id( 'status' ) ); ?>"><?php esc_attr_e( 'Status:', 'sportspress' ); ?></label>
|
||||
<?php
|
||||
$args = array(
|
||||
'show_option_default' => __( 'Default', 'sportspress' ),
|
||||
'show_option_default' => esc_attr__( 'Default', 'sportspress' ),
|
||||
'name' => $this->get_field_name( 'status' ),
|
||||
'id' => $this->get_field_id( 'status' ),
|
||||
'selected' => $status,
|
||||
@@ -175,10 +175,10 @@ class SP_Widget_Event_List extends WP_Widget {
|
||||
</p>
|
||||
|
||||
<div class="sp-date-selector">
|
||||
<p><label for="<?php echo $this->get_field_id( 'date' ); ?>"><?php _e( 'Date:', 'sportspress' ); ?></label>
|
||||
<p><label for="<?php echo esc_attr( $this->get_field_id( 'date' ) ); ?>"><?php esc_attr_e( 'Date:', 'sportspress' ); ?></label>
|
||||
<?php
|
||||
$args = array(
|
||||
'show_option_default' => __( 'Default', 'sportspress' ),
|
||||
'show_option_default' => esc_attr__( 'Default', 'sportspress' ),
|
||||
'name' => $this->get_field_name( 'date' ),
|
||||
'id' => $this->get_field_id( 'date' ),
|
||||
'selected' => $date,
|
||||
@@ -197,9 +197,9 @@ class SP_Widget_Event_List extends WP_Widget {
|
||||
if ( $date_relative ) :
|
||||
?>
|
||||
hidden<?php endif; ?>">
|
||||
<input type="text" name="<?php echo $this->get_field_name( 'date_from' ); ?>" value="<?php echo $date_from; ?>" placeholder="yyyy-mm-dd" size="10">
|
||||
<input type="text" name="<?php echo esc_attr( $this->get_field_name( 'date_from' ) ); ?>" value="<?php echo esc_attr( $date_from ); ?>" placeholder="yyyy-mm-dd" size="10">
|
||||
:
|
||||
<input type="text" name="<?php echo $this->get_field_name( 'date_to' ); ?>" value="<?php echo $date_to; ?>" placeholder="yyyy-mm-dd" size="10">
|
||||
<input type="text" name="<?php echo esc_attr( $this->get_field_name( 'date_to' ) ); ?>" value="<?php echo esc_attr( $date_to ); ?>" placeholder="yyyy-mm-dd" size="10">
|
||||
</p>
|
||||
|
||||
<p class="sp-date-range-relative
|
||||
@@ -207,70 +207,70 @@ class SP_Widget_Event_List extends WP_Widget {
|
||||
if ( ! $date_relative ) :
|
||||
?>
|
||||
hidden<?php endif; ?>">
|
||||
<?php _e( 'Past', 'sportspress' ); ?>
|
||||
<input type="number" min="0" step="1" class="tiny-text" name="<?php echo $this->get_field_name( 'date_past' ); ?>" value="<?php echo $date_past; ?>">
|
||||
<?php esc_attr_e( 'Past', 'sportspress' ); ?>
|
||||
<input type="number" min="0" step="1" class="tiny-text" name="<?php echo esc_attr( $this->get_field_name( 'date_past' ) ); ?>" value="<?php echo esc_attr( $date_past ); ?>">
|
||||
→
|
||||
<?php _e( 'Next', 'sportspress' ); ?>
|
||||
<input type="number" min="0" step="1" class="tiny-text" name="<?php echo $this->get_field_name( 'date_future' ); ?>" value="<?php echo $date_future; ?>">
|
||||
<?php _e( 'days', 'sportspress' ); ?>
|
||||
<?php esc_attr_e( 'Next', 'sportspress' ); ?>
|
||||
<input type="number" min="0" step="1" class="tiny-text" name="<?php echo esc_attr( $this->get_field_name( 'date_future' ) ); ?>" value="<?php echo esc_attr( $date_future ); ?>">
|
||||
<?php esc_attr_e( 'days', 'sportspress' ); ?>
|
||||
</p>
|
||||
|
||||
<p class="sp-date-relative">
|
||||
<label>
|
||||
<input type="checkbox" name="<?php echo $this->get_field_name( 'date_relative' ); ?>" value="1" id="<?php echo $this->get_field_id( 'date_relative' ); ?>" <?php checked( $date_relative ); ?>>
|
||||
<?php _e( 'Relative', 'sportspress' ); ?>
|
||||
<input type="checkbox" name="<?php echo esc_attr( $this->get_field_name( 'date_relative' ) ); ?>" value="1" id="<?php echo esc_attr( $this->get_field_id( 'date_relative' ) ); ?>" <?php checked( $date_relative ); ?>>
|
||||
<?php esc_attr_e( 'Relative', 'sportspress' ); ?>
|
||||
</label>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p><label for="<?php echo $this->get_field_id( 'day' ); ?>"><?php _e( 'Match Day:', 'sportspress' ); ?></label>
|
||||
<input id="<?php echo $this->get_field_id( 'day' ); ?>" name="<?php echo $this->get_field_name( 'day' ); ?>" type="text" placeholder="<?php _e( 'All', 'sportspress' ); ?>" value="<?php echo esc_attr( $day ); ?>" size="10"></p>
|
||||
<p><label for="<?php echo esc_attr( $this->get_field_id( 'day' ) ); ?>"><?php esc_attr_e( 'Match Day:', 'sportspress' ); ?></label>
|
||||
<input id="<?php echo esc_attr( $this->get_field_id( 'day' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'day' ) ); ?>" type="text" placeholder="<?php esc_attr_e( 'All', 'sportspress' ); ?>" value="<?php echo esc_attr( $day ); ?>" size="10"></p>
|
||||
|
||||
<p><label for="<?php echo $this->get_field_id( 'number' ); ?>"><?php _e( 'Number of events to show:', 'sportspress' ); ?></label>
|
||||
<input id="<?php echo $this->get_field_id( 'number' ); ?>" name="<?php echo $this->get_field_name( 'number' ); ?>" type="text" value="<?php echo esc_attr( $number ); ?>" size="3"></p>
|
||||
<p><label for="<?php echo esc_attr( $this->get_field_id( 'number' ) ); ?>"><?php esc_attr_e( 'Number of events to show:', 'sportspress' ); ?></label>
|
||||
<input id="<?php echo esc_attr( $this->get_field_id( 'number' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'number' ) ); ?>" type="text" value="<?php echo esc_attr( $number ); ?>" size="3"></p>
|
||||
|
||||
<p><label for="<?php echo $this->get_field_id( 'order' ); ?>"><?php _e( 'Sort Order:', 'sportspress' ); ?></label>
|
||||
<select name="<?php echo $this->get_field_name( 'order' ); ?>" id="<?php echo $this->get_field_id( 'order' ); ?>" class="sp-select-order widefat">
|
||||
<option value="default" <?php selected( 'default', $order ); ?>><?php _e( 'Default', 'sportspress' ); ?></option>
|
||||
<option value="ASC" <?php selected( 'ASC', $order ); ?>><?php _e( 'Ascending', 'sportspress' ); ?></option>
|
||||
<option value="DESC" <?php selected( 'DESC', $order ); ?>><?php _e( 'Descending', 'sportspress' ); ?></option>
|
||||
<p><label for="<?php echo esc_attr( $this->get_field_id( 'order' ) ); ?>"><?php esc_attr_e( 'Sort Order:', 'sportspress' ); ?></label>
|
||||
<select name="<?php echo esc_attr( $this->get_field_name( 'order' ) ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'order' ) ); ?>" class="sp-select-order widefat">
|
||||
<option value="default" <?php selected( 'default', $order ); ?>><?php esc_attr_e( 'Default', 'sportspress' ); ?></option>
|
||||
<option value="ASC" <?php selected( 'ASC', $order ); ?>><?php esc_attr_e( 'Ascending', 'sportspress' ); ?></option>
|
||||
<option value="DESC" <?php selected( 'DESC', $order ); ?>><?php esc_attr_e( 'Descending', 'sportspress' ); ?></option>
|
||||
</select></p>
|
||||
|
||||
<p class="sp-prefs">
|
||||
<?php _e( 'Columns:', 'sportspress' ); ?><br>
|
||||
<?php esc_attr_e( 'Columns:', 'sportspress' ); ?><br>
|
||||
<?php
|
||||
$the_columns = array();
|
||||
$the_columns['event'] = __( 'Event', 'sportspress' );
|
||||
$the_columns['event'] = esc_attr__( 'Event', 'sportspress' );
|
||||
|
||||
if ( 'combined' === $time_format ) {
|
||||
|
||||
$the_columns['time'] = __( 'Time/Results', 'sportspress' );
|
||||
$the_columns['time'] = esc_attr__( 'Time/Results', 'sportspress' );
|
||||
|
||||
} else {
|
||||
|
||||
if ( in_array( $time_format, array( 'time', 'separate' ) ) ) {
|
||||
$the_columns['time'] = __( 'Time', 'sportspress' );
|
||||
$the_columns['time'] = esc_attr__( 'Time', 'sportspress' );
|
||||
}
|
||||
|
||||
if ( in_array( $time_format, array( 'results', 'separate' ) ) ) {
|
||||
$the_columns['results'] = __( 'Results', 'sportspress' );
|
||||
$the_columns['results'] = esc_attr__( 'Results', 'sportspress' );
|
||||
}
|
||||
}
|
||||
|
||||
$the_columns['venue'] = __( 'Venue', 'sportspress' );
|
||||
$the_columns['article'] = __( 'Article', 'sportspress' );
|
||||
$the_columns['day'] = __( 'Match Day', 'sportspress' );
|
||||
$the_columns['venue'] = esc_attr__( 'Venue', 'sportspress' );
|
||||
$the_columns['article'] = esc_attr__( 'Article', 'sportspress' );
|
||||
$the_columns['day'] = esc_attr__( 'Match Day', 'sportspress' );
|
||||
|
||||
$field_name = $this->get_field_name( 'columns' ) . '[]';
|
||||
$field_id = $this->get_field_id( 'columns' );
|
||||
?>
|
||||
<?php foreach ( $the_columns as $key => $label ) : ?>
|
||||
<label class="button"><input name="<?php echo $field_name; ?>" type="checkbox" id="<?php echo $field_id . '-' . $key; ?>" value="<?php echo $key; ?>"
|
||||
<label class="button"><input name="<?php echo esc_attr( $field_name ); ?>" type="checkbox" id="<?php echo esc_attr( $field_id . '-' . $key ); ?>" value="<?php echo esc_attr( $key ); ?>"
|
||||
<?php
|
||||
if ( $columns === null || in_array( $key, $columns ) ) :
|
||||
?>
|
||||
checked="checked"<?php endif; ?>><?php echo $label; ?></label>
|
||||
checked="checked"<?php endif; ?>><?php echo esc_attr( $label ); ?></label>
|
||||
<?php endforeach; ?>
|
||||
</p>
|
||||
|
||||
@@ -278,8 +278,8 @@ class SP_Widget_Event_List extends WP_Widget {
|
||||
<?php
|
||||
if ( ! $id ) :
|
||||
?>
|
||||
hidden<?php endif; ?>"><input class="checkbox" type="checkbox" id="<?php echo $this->get_field_id( 'show_all_events_link' ); ?>" name="<?php echo $this->get_field_name( 'show_all_events_link' ); ?>" value="1" <?php checked( $show_all_events_link, 1 ); ?>>
|
||||
<label for="<?php echo $this->get_field_id( 'show_all_events_link' ); ?>"><?php _e( 'Display link to view all events', 'sportspress' ); ?></label></p>
|
||||
hidden<?php endif; ?>"><input class="checkbox" type="checkbox" id="<?php echo esc_attr( $this->get_field_id( 'show_all_events_link' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'show_all_events_link' ) ); ?>" value="1" <?php checked( $show_all_events_link, 1 ); ?>>
|
||||
<label for="<?php echo esc_attr( $this->get_field_id( 'show_all_events_link' ) ); ?>"><?php esc_attr_e( 'Display link to view all events', 'sportspress' ); ?></label></p>
|
||||
|
||||
<?php
|
||||
// Action to hook into
|
||||
|
||||
@@ -4,9 +4,9 @@ class SP_Widget_League_Table extends WP_Widget {
|
||||
function __construct() {
|
||||
$widget_ops = array(
|
||||
'classname' => 'widget_sportspress widget_league_table widget_sp_league_table',
|
||||
'description' => __( 'Display a league table.', 'sportspress' ),
|
||||
'description' => esc_attr__( 'Display a league table.', 'sportspress' ),
|
||||
);
|
||||
parent::__construct( 'sportspress-league-table', __( 'League Table', 'sportspress' ), $widget_ops );
|
||||
parent::__construct( 'sportspress-league-table', esc_attr__( 'League Table', 'sportspress' ), $widget_ops );
|
||||
}
|
||||
|
||||
function widget( $args, $instance ) {
|
||||
@@ -30,10 +30,10 @@ class SP_Widget_League_Table extends WP_Widget {
|
||||
$show_full_table_link = empty( $instance['show_full_table_link'] ) ? false : $instance['show_full_table_link'];
|
||||
|
||||
do_action( 'sportspress_before_widget', $args, $instance, 'league-table' );
|
||||
echo $before_widget;
|
||||
echo wp_kses_post( $before_widget );
|
||||
|
||||
if ( $title ) {
|
||||
echo $before_title . $title . $after_title;
|
||||
echo wp_kses_post( $before_title . $title . $after_title );
|
||||
}
|
||||
|
||||
// Action to hook into
|
||||
@@ -54,7 +54,7 @@ class SP_Widget_League_Table extends WP_Widget {
|
||||
// Action to hook into
|
||||
do_action( 'sportspress_after_widget_template', $args, $instance, 'league-table' );
|
||||
|
||||
echo $after_widget;
|
||||
echo wp_kses_post( $after_widget );
|
||||
do_action( 'sportspress_after_widget', $args, $instance, 'league-table' );
|
||||
}
|
||||
|
||||
@@ -99,34 +99,34 @@ class SP_Widget_League_Table extends WP_Widget {
|
||||
// Action to hook into
|
||||
do_action( 'sportspress_before_widget_template_form', $this, $instance, 'league-table' );
|
||||
?>
|
||||
<p><label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', 'sportspress' ); ?></label>
|
||||
<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" /></p>
|
||||
<p><label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php esc_attr_e( 'Title:', 'sportspress' ); ?></label>
|
||||
<input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" /></p>
|
||||
|
||||
<p><label for="<?php echo $this->get_field_id( 'caption' ); ?>"><?php _e( 'Heading:', 'sportspress' ); ?></label>
|
||||
<input class="widefat" id="<?php echo $this->get_field_id( 'caption' ); ?>" name="<?php echo $this->get_field_name( 'caption' ); ?>" type="text" value="<?php echo esc_attr( $caption ); ?>" /></p>
|
||||
<p><label for="<?php echo esc_attr( $this->get_field_id( 'caption' ) ); ?>"><?php esc_attr_e( 'Heading:', 'sportspress' ); ?></label>
|
||||
<input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'caption' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'caption' ) ); ?>" type="text" value="<?php echo esc_attr( $caption ); ?>" /></p>
|
||||
|
||||
<p><label for="<?php echo $this->get_field_id( 'id' ); ?>"><?php printf( __( 'Select %s:', 'sportspress' ), __( 'League Table', 'sportspress' ) ); ?></label>
|
||||
<p><label for="<?php echo esc_attr( $this->get_field_id( 'id' ) ); ?>"><?php printf( esc_attr__( 'Select %s:', 'sportspress' ), esc_attr__( 'League Table', 'sportspress' ) ); ?></label>
|
||||
<?php
|
||||
$args = array(
|
||||
'post_type' => 'sp_table',
|
||||
'name' => $this->get_field_name( 'id' ),
|
||||
'id' => $this->get_field_id( 'id' ),
|
||||
'show_option_none' => __( '— Select —', 'sportspress' ),
|
||||
'show_option_none' => esc_attr__( '— Select —', 'sportspress' ),
|
||||
'selected' => $id,
|
||||
'values' => 'ID',
|
||||
'class' => 'widefat',
|
||||
);
|
||||
if ( ! sp_dropdown_pages( $args ) ) :
|
||||
sp_post_adder( 'sp_table', __( 'Add New', 'sportspress' ) );
|
||||
sp_post_adder( 'sp_table', esc_attr__( 'Add New', 'sportspress' ) );
|
||||
endif;
|
||||
?>
|
||||
</p>
|
||||
|
||||
<p><label for="<?php echo $this->get_field_id( 'number' ); ?>"><?php _e( 'Number of teams to show:', 'sportspress' ); ?></label>
|
||||
<input id="<?php echo $this->get_field_id( 'number' ); ?>" name="<?php echo $this->get_field_name( 'number' ); ?>" type="text" value="<?php echo esc_attr( $number ); ?>" size="3"></p>
|
||||
<p><label for="<?php echo esc_attr( $this->get_field_id( 'number' ) ); ?>"><?php esc_attr_e( 'Number of teams to show:', 'sportspress' ); ?></label>
|
||||
<input id="<?php echo esc_attr( $this->get_field_id( 'number' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'number' ) ); ?>" type="text" value="<?php echo esc_attr( $number ); ?>" size="3"></p>
|
||||
|
||||
<p class="sp-prefs">
|
||||
<?php _e( 'Columns:', 'sportspress' ); ?><br>
|
||||
<?php esc_attr_e( 'Columns:', 'sportspress' ); ?><br>
|
||||
<?php
|
||||
$args = array(
|
||||
'post_type' => 'sp_column',
|
||||
@@ -141,19 +141,19 @@ class SP_Widget_League_Table extends WP_Widget {
|
||||
$field_id = $this->get_field_id( 'columns' );
|
||||
?>
|
||||
<?php foreach ( $the_columns as $column ) : ?>
|
||||
<label class="button"><input name="<?php echo $field_name; ?>" type="checkbox" id="<?php echo $field_id . '-' . $column->post_name; ?>" value="<?php echo $column->post_name; ?>"
|
||||
<label class="button"><input name="<?php echo esc_attr( $field_name ); ?>" type="checkbox" id="<?php echo esc_attr( $field_id ) . '-' . esc_attr( $column->post_name ); ?>" value="<?php echo esc_attr( $column->post_name ); ?>"
|
||||
<?php
|
||||
if ( $columns === null || in_array( $column->post_name, $columns ) ) :
|
||||
?>
|
||||
checked="checked"<?php endif; ?>><?php echo $column->post_title; ?></label>
|
||||
checked="checked"<?php endif; ?>><?php echo esc_attr( $column->post_title ); ?></label>
|
||||
<?php endforeach; ?>
|
||||
</p>
|
||||
|
||||
<p><input class="checkbox" type="checkbox" id="<?php echo $this->get_field_id( 'show_team_logo' ); ?>" name="<?php echo $this->get_field_name( 'show_team_logo' ); ?>" value="1" <?php checked( $show_team_logo, 1 ); ?>>
|
||||
<label for="<?php echo $this->get_field_id( 'show_team_logo' ); ?>"><?php _e( 'Display logos', 'sportspress' ); ?></label><br>
|
||||
<p><input class="checkbox" type="checkbox" id="<?php echo esc_attr( $this->get_field_id( 'show_team_logo' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'show_team_logo' ) ); ?>" value="1" <?php checked( $show_team_logo, 1 ); ?>>
|
||||
<label for="<?php echo esc_attr( $this->get_field_id( 'show_team_logo' ) ); ?>"><?php esc_attr_e( 'Display logos', 'sportspress' ); ?></label><br>
|
||||
|
||||
<input class="checkbox" type="checkbox" id="<?php echo $this->get_field_id( 'show_full_table_link' ); ?>" name="<?php echo $this->get_field_name( 'show_full_table_link' ); ?>" value="1" <?php checked( $show_full_table_link, 1 ); ?>>
|
||||
<label for="<?php echo $this->get_field_id( 'show_full_table_link' ); ?>"><?php _e( 'Display link to view full table', 'sportspress' ); ?></label></p>
|
||||
<input class="checkbox" type="checkbox" id="<?php echo esc_attr( $this->get_field_id( 'show_full_table_link' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'show_full_table_link' ) ); ?>" value="1" <?php checked( $show_full_table_link, 1 ); ?>>
|
||||
<label for="<?php echo esc_attr( $this->get_field_id( 'show_full_table_link' ) ); ?>"><?php esc_attr_e( 'Display link to view full table', 'sportspress' ); ?></label></p>
|
||||
|
||||
<?php
|
||||
// Action to hook into
|
||||
|
||||
@@ -4,9 +4,9 @@ class SP_Widget_Player_Gallery extends WP_Widget {
|
||||
function __construct() {
|
||||
$widget_ops = array(
|
||||
'classname' => 'widget_sportspress widget_player_gallery widget_sp_player_gallery',
|
||||
'description' => __( 'Display a gallery of players.', 'sportspress' ),
|
||||
'description' => esc_attr__( 'Display a gallery of players.', 'sportspress' ),
|
||||
);
|
||||
parent::__construct( 'sportspress-player-gallery', __( 'Player Gallery', 'sportspress' ), $widget_ops );
|
||||
parent::__construct( 'sportspress-player-gallery', esc_attr__( 'Player Gallery', 'sportspress' ), $widget_ops );
|
||||
}
|
||||
|
||||
function widget( $args, $instance ) {
|
||||
@@ -34,10 +34,10 @@ class SP_Widget_Player_Gallery extends WP_Widget {
|
||||
$show_all_players_link = empty( $instance['show_all_players_link'] ) ? false : $instance['show_all_players_link'];
|
||||
|
||||
do_action( 'sportspress_before_widget', $args, $instance, 'player-gallery' );
|
||||
echo $before_widget;
|
||||
echo wp_kses_post( $before_widget );
|
||||
|
||||
if ( $title ) {
|
||||
echo $before_title . $title . $after_title;
|
||||
echo wp_kses_post( $before_title . $title . $after_title );
|
||||
}
|
||||
|
||||
// Action to hook into
|
||||
@@ -60,7 +60,7 @@ class SP_Widget_Player_Gallery extends WP_Widget {
|
||||
// Action to hook into
|
||||
do_action( 'sportspress_after_widget_template', $args, $instance, 'player-gallery' );
|
||||
|
||||
echo $after_widget;
|
||||
echo wp_kses_post( $after_widget );
|
||||
do_action( 'sportspress_after_widget', $args, $instance, 'player-gallery' );
|
||||
}
|
||||
|
||||
@@ -107,13 +107,13 @@ class SP_Widget_Player_Gallery extends WP_Widget {
|
||||
// Action to hook into
|
||||
do_action( 'sportspress_before_widget_template_form', $this, $instance, 'player-gallery' );
|
||||
?>
|
||||
<p><label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', 'sportspress' ); ?></label>
|
||||
<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" /></p>
|
||||
<p><label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php esc_attr_e( 'Title:', 'sportspress' ); ?></label>
|
||||
<input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" /></p>
|
||||
|
||||
<p><label for="<?php echo $this->get_field_id( 'caption' ); ?>"><?php _e( 'Heading:', 'sportspress' ); ?></label>
|
||||
<input class="widefat" id="<?php echo $this->get_field_id( 'caption' ); ?>" name="<?php echo $this->get_field_name( 'caption' ); ?>" type="text" value="<?php echo esc_attr( $caption ); ?>" /></p>
|
||||
<p><label for="<?php echo esc_attr( $this->get_field_id( 'caption' ) ); ?>"><?php esc_attr_e( 'Heading:', 'sportspress' ); ?></label>
|
||||
<input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'caption' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'caption' ) ); ?>" type="text" value="<?php echo esc_attr( $caption ); ?>" /></p>
|
||||
|
||||
<p><label for="<?php echo $this->get_field_id( 'id' ); ?>"><?php printf( __( 'Select %s:', 'sportspress' ), __( 'Player List', 'sportspress' ) ); ?></label>
|
||||
<p><label for="<?php echo esc_attr( $this->get_field_id( 'id' ) ); ?>"><?php printf( esc_attr__( 'Select %s:', 'sportspress' ), esc_attr__( 'Player List', 'sportspress' ) ); ?></label>
|
||||
<?php
|
||||
$args = array(
|
||||
'post_type' => 'sp_list',
|
||||
@@ -124,28 +124,28 @@ class SP_Widget_Player_Gallery extends WP_Widget {
|
||||
'class' => 'widefat',
|
||||
);
|
||||
if ( ! sp_dropdown_pages( $args ) ) :
|
||||
sp_post_adder( 'sp_list', __( 'Add New', 'sportspress' ) );
|
||||
sp_post_adder( 'sp_list', esc_attr__( 'Add New', 'sportspress' ) );
|
||||
endif;
|
||||
?>
|
||||
</p>
|
||||
|
||||
<p><label for="<?php echo $this->get_field_id( 'number' ); ?>"><?php _e( 'Number of players to show:', 'sportspress' ); ?></label>
|
||||
<input id="<?php echo $this->get_field_id( 'number' ); ?>" name="<?php echo $this->get_field_name( 'number' ); ?>" type="text" value="<?php echo esc_attr( $number ); ?>" size="3"></p>
|
||||
<p><label for="<?php echo esc_attr( $this->get_field_id( 'number' ) ); ?>"><?php esc_attr_e( 'Number of players to show:', 'sportspress' ); ?></label>
|
||||
<input id="<?php echo esc_attr( $this->get_field_id( 'number' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'number' ) ); ?>" type="text" value="<?php echo esc_attr( $number ); ?>" size="3"></p>
|
||||
|
||||
<p><label for="<?php echo $this->get_field_id( 'columns' ); ?>"><?php _e( 'Columns:', 'sportspress' ); ?></label>
|
||||
<input id="<?php echo $this->get_field_id( 'columns' ); ?>" name="<?php echo $this->get_field_name( 'columns' ); ?>" type="text" value="<?php echo esc_attr( $columns ); ?>" size="3"></p>
|
||||
<p><label for="<?php echo esc_attr( $this->get_field_id( 'columns' ) ); ?>"><?php esc_attr_e( 'Columns:', 'sportspress' ); ?></label>
|
||||
<input id="<?php echo esc_attr( $this->get_field_id( 'columns' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'columns' ) ); ?>" type="text" value="<?php echo esc_attr( $columns ); ?>" size="3"></p>
|
||||
|
||||
<p><label for="<?php echo $this->get_field_id( 'orderby' ); ?>"><?php _e( 'Sort by:', 'sportspress' ); ?></label>
|
||||
<p><label for="<?php echo esc_attr( $this->get_field_id( 'orderby' ) ); ?>"><?php esc_attr_e( 'Sort by:', 'sportspress' ); ?></label>
|
||||
<?php
|
||||
$args = array(
|
||||
'prepend_options' => array(
|
||||
'default' => __( 'Default', 'sportspress' ),
|
||||
'number' => __( 'Squad Number', 'sportspress' ),
|
||||
'name' => __( 'Name', 'sportspress' ),
|
||||
'eventsplayed' => __( 'Played', 'sportspress' ),
|
||||
'default' => esc_attr__( 'Default', 'sportspress' ),
|
||||
'number' => esc_attr__( 'Squad Number', 'sportspress' ),
|
||||
'name' => esc_attr__( 'Name', 'sportspress' ),
|
||||
'eventsplayed' => esc_attr__( 'Played', 'sportspress' ),
|
||||
),
|
||||
'append_options' => array(
|
||||
'rand' => __( 'Random', 'sportspress' ),
|
||||
'rand' => esc_attr__( 'Random', 'sportspress' ),
|
||||
),
|
||||
'post_type' => 'sp_performance',
|
||||
'name' => $this->get_field_name( 'orderby' ),
|
||||
@@ -155,19 +155,19 @@ class SP_Widget_Player_Gallery extends WP_Widget {
|
||||
'class' => 'sp-select-orderby widefat',
|
||||
);
|
||||
if ( ! sp_dropdown_pages( $args ) ) :
|
||||
sp_post_adder( 'sp_list', __( 'Add New', 'sportspress' ) );
|
||||
sp_post_adder( 'sp_list', esc_attr__( 'Add New', 'sportspress' ) );
|
||||
endif;
|
||||
?>
|
||||
</p>
|
||||
|
||||
<p><label for="<?php echo $this->get_field_id( 'order' ); ?>"><?php _e( 'Sort Order:', 'sportspress' ); ?></label>
|
||||
<select name="<?php echo $this->get_field_name( 'order' ); ?>" id="<?php echo $this->get_field_id( 'order' ); ?>" class="sp-select-order widefat" <?php disabled( $orderby, 'default' ); ?>>
|
||||
<option value="ASC" <?php selected( 'ASC', $order ); ?>><?php _e( 'Ascending', 'sportspress' ); ?></option>
|
||||
<option value="DESC" <?php selected( 'DESC', $order ); ?>><?php _e( 'Descending', 'sportspress' ); ?></option>
|
||||
<p><label for="<?php echo esc_attr( $this->get_field_id( 'order' ) ); ?>"><?php esc_attr_e( 'Sort Order:', 'sportspress' ); ?></label>
|
||||
<select name="<?php echo esc_attr( $this->get_field_name( 'order' ) ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'order' ) ); ?>" class="sp-select-order widefat" <?php disabled( $orderby, 'default' ); ?>>
|
||||
<option value="ASC" <?php selected( 'ASC', $order ); ?>><?php esc_attr_e( 'Ascending', 'sportspress' ); ?></option>
|
||||
<option value="DESC" <?php selected( 'DESC', $order ); ?>><?php esc_attr_e( 'Descending', 'sportspress' ); ?></option>
|
||||
</select></p>
|
||||
|
||||
<p><input class="checkbox" type="checkbox" id="<?php echo $this->get_field_id( 'show_all_players_link' ); ?>" name="<?php echo $this->get_field_name( 'show_all_players_link' ); ?>" value="1" <?php checked( $show_all_players_link, 1 ); ?>>
|
||||
<label for="<?php echo $this->get_field_id( 'show_all_players_link' ); ?>"><?php _e( 'Display link to view all players', 'sportspress' ); ?></label></p>
|
||||
<p><input class="checkbox" type="checkbox" id="<?php echo esc_attr( $this->get_field_id( 'show_all_players_link' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'show_all_players_link' ) ); ?>" value="1" <?php checked( $show_all_players_link, 1 ); ?>>
|
||||
<label for="<?php echo esc_attr( $this->get_field_id( 'show_all_players_link' ) ); ?>"><?php esc_attr_e( 'Display link to view all players', 'sportspress' ); ?></label></p>
|
||||
|
||||
<?php
|
||||
// Action to hook into
|
||||
|
||||
@@ -4,9 +4,9 @@ class SP_Widget_Player_list extends WP_Widget {
|
||||
function __construct() {
|
||||
$widget_ops = array(
|
||||
'classname' => 'widget_sportspress widget_player_list widget_sp_player_list',
|
||||
'description' => __( 'Display a list of players.', 'sportspress' ),
|
||||
'description' => esc_attr__( 'Display a list of players.', 'sportspress' ),
|
||||
);
|
||||
parent::__construct( 'sportspress-player-list', __( 'Player List', 'sportspress' ), $widget_ops );
|
||||
parent::__construct( 'sportspress-player-list', esc_attr__( 'Player List', 'sportspress' ), $widget_ops );
|
||||
}
|
||||
|
||||
function widget( $args, $instance ) {
|
||||
@@ -34,10 +34,10 @@ class SP_Widget_Player_list extends WP_Widget {
|
||||
$show_all_players_link = empty( $instance['show_all_players_link'] ) ? false : $instance['show_all_players_link'];
|
||||
|
||||
do_action( 'sportspress_before_widget', $args, $instance, 'player-list' );
|
||||
echo $before_widget;
|
||||
echo wp_kses_post( $before_widget );
|
||||
|
||||
if ( $title ) {
|
||||
echo $before_title . $title . $after_title;
|
||||
echo wp_kses_post( $before_title . $title . $after_title );
|
||||
}
|
||||
|
||||
// Action to hook into
|
||||
@@ -60,7 +60,7 @@ class SP_Widget_Player_list extends WP_Widget {
|
||||
// Action to hook into
|
||||
do_action( 'sportspress_after_widget_template', $args, $instance, 'player-list' );
|
||||
|
||||
echo $after_widget;
|
||||
echo wp_kses_post( $after_widget );
|
||||
do_action( 'sportspress_after_widget', $args, $instance, 'player-list' );
|
||||
}
|
||||
|
||||
@@ -107,13 +107,13 @@ class SP_Widget_Player_list extends WP_Widget {
|
||||
// Action to hook into
|
||||
do_action( 'sportspress_before_widget_template_form', $this, $instance, 'player-list' );
|
||||
?>
|
||||
<p><label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', 'sportspress' ); ?></label>
|
||||
<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" /></p>
|
||||
<p><label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php esc_attr_e( 'Title:', 'sportspress' ); ?></label>
|
||||
<input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" /></p>
|
||||
|
||||
<p><label for="<?php echo $this->get_field_id( 'caption' ); ?>"><?php _e( 'Heading:', 'sportspress' ); ?></label>
|
||||
<input class="widefat" id="<?php echo $this->get_field_id( 'caption' ); ?>" name="<?php echo $this->get_field_name( 'caption' ); ?>" type="text" value="<?php echo esc_attr( $caption ); ?>" /></p>
|
||||
<p><label for="<?php echo esc_attr( $this->get_field_id( 'caption' ) ); ?>"><?php esc_attr_e( 'Heading:', 'sportspress' ); ?></label>
|
||||
<input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'caption' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'caption' ) ); ?>" type="text" value="<?php echo esc_attr( $caption ); ?>" /></p>
|
||||
|
||||
<p><label for="<?php echo $this->get_field_id( 'id' ); ?>"><?php printf( __( 'Select %s:', 'sportspress' ), __( 'Player List', 'sportspress' ) ); ?></label>
|
||||
<p><label for="<?php echo esc_attr( $this->get_field_id( 'id' ) ); ?>"><?php printf( esc_attr__( 'Select %s:', 'sportspress' ), esc_attr__( 'Player List', 'sportspress' ) ); ?></label>
|
||||
<?php
|
||||
$args = array(
|
||||
'post_type' => 'sp_list',
|
||||
@@ -124,16 +124,16 @@ class SP_Widget_Player_list extends WP_Widget {
|
||||
'class' => 'widefat',
|
||||
);
|
||||
if ( ! sp_dropdown_pages( $args ) ) :
|
||||
sp_post_adder( 'sp_list', __( 'Add New', 'sportspress' ) );
|
||||
sp_post_adder( 'sp_list', esc_attr__( 'Add New', 'sportspress' ) );
|
||||
endif;
|
||||
?>
|
||||
</p>
|
||||
|
||||
<p><label for="<?php echo $this->get_field_id( 'number' ); ?>"><?php _e( 'Number of players to show:', 'sportspress' ); ?></label>
|
||||
<input id="<?php echo $this->get_field_id( 'number' ); ?>" name="<?php echo $this->get_field_name( 'number' ); ?>" type="text" value="<?php echo esc_attr( $number ); ?>" size="3"></p>
|
||||
<p><label for="<?php echo esc_attr( $this->get_field_id( 'number' ) ); ?>"><?php esc_attr_e( 'Number of players to show:', 'sportspress' ); ?></label>
|
||||
<input id="<?php echo esc_attr( $this->get_field_id( 'number' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'number' ) ); ?>" type="text" value="<?php echo esc_attr( $number ); ?>" size="3"></p>
|
||||
|
||||
<p class="sp-prefs">
|
||||
<?php _e( 'Performance:', 'sportspress' ); ?><br>
|
||||
<?php esc_attr_e( 'Performance:', 'sportspress' ); ?><br>
|
||||
<?php
|
||||
$args = array(
|
||||
'post_type' => array( 'sp_metric', 'sp_performance', 'sp_statistic' ),
|
||||
@@ -147,40 +147,40 @@ class SP_Widget_Player_list extends WP_Widget {
|
||||
$field_name = $this->get_field_name( 'columns' ) . '[]';
|
||||
$field_id = $this->get_field_id( 'columns' );
|
||||
?>
|
||||
<label class="button"><input name="<?php echo $field_name; ?>" type="checkbox" id="<?php echo $field_id; ?>-number" value="number"
|
||||
<label class="button"><input name="<?php echo esc_attr( $field_name ); ?>" type="checkbox" id="<?php echo esc_attr( $field_id ); ?>-number" value="number"
|
||||
<?php
|
||||
if ( $columns === null || in_array( 'number', $columns ) ) :
|
||||
?>
|
||||
checked="checked"<?php endif; ?>>
|
||||
<?php
|
||||
if ( 'default' == $orderby ) {
|
||||
_e( 'Rank', 'sportspress' );
|
||||
esc_attr_e( 'Rank', 'sportspress' );
|
||||
echo '/';
|
||||
_e( 'Squad Number', 'sportspress' );
|
||||
esc_attr_e( 'Squad Number', 'sportspress' );
|
||||
} elseif ( in_array( $orderby, array( 'number', 'name' ) ) ) {
|
||||
_e( 'Squad Number', 'sportspress' );
|
||||
esc_attr_e( 'Squad Number', 'sportspress' );
|
||||
} else {
|
||||
_e( 'Rank', 'sportspress' );
|
||||
esc_attr_e( 'Rank', 'sportspress' );
|
||||
}
|
||||
?>
|
||||
</label>
|
||||
<?php foreach ( $the_columns as $column ) : ?>
|
||||
<label class="button"><input name="<?php echo $field_name; ?>" type="checkbox" id="<?php echo $field_id . '-' . $column->post_name; ?>" value="<?php echo $column->post_name; ?>"
|
||||
<label class="button"><input name="<?php echo esc_attr( $field_name ); ?>" type="checkbox" id="<?php echo esc_attr( $field_id . '-' . $column->post_name ); ?>" value="<?php echo esc_attr( $column->post_name ); ?>"
|
||||
<?php
|
||||
if ( $columns === null || in_array( $column->post_name, $columns ) ) :
|
||||
?>
|
||||
checked="checked"<?php endif; ?>><?php echo $column->post_title; ?></label>
|
||||
checked="checked"<?php endif; ?>><?php echo esc_attr( $column->post_title ); ?></label>
|
||||
<?php endforeach; ?>
|
||||
</p>
|
||||
|
||||
<p><label for="<?php echo $this->get_field_id( 'orderby' ); ?>"><?php _e( 'Sort by:', 'sportspress' ); ?></label>
|
||||
<p><label for="<?php echo esc_attr( $this->get_field_id( 'orderby' ) ); ?>"><?php esc_attr_e( 'Sort by:', 'sportspress' ); ?></label>
|
||||
<?php
|
||||
$args = array(
|
||||
'prepend_options' => array(
|
||||
'default' => __( 'Default', 'sportspress' ),
|
||||
'number' => __( 'Squad Number', 'sportspress' ),
|
||||
'name' => __( 'Name', 'sportspress' ),
|
||||
'eventsplayed' => __( 'Played', 'sportspress' ),
|
||||
'default' => esc_attr__( 'Default', 'sportspress' ),
|
||||
'number' => esc_attr__( 'Squad Number', 'sportspress' ),
|
||||
'name' => esc_attr__( 'Name', 'sportspress' ),
|
||||
'eventsplayed' => esc_attr__( 'Played', 'sportspress' ),
|
||||
),
|
||||
'post_type' => array( 'sp_metric', 'sp_performance', 'sp_statistic' ),
|
||||
'name' => $this->get_field_name( 'orderby' ),
|
||||
@@ -190,19 +190,19 @@ class SP_Widget_Player_list extends WP_Widget {
|
||||
'class' => 'sp-select-orderby widefat',
|
||||
);
|
||||
if ( ! sp_dropdown_pages( $args ) ) :
|
||||
sp_post_adder( 'sp_list', __( 'Add New', 'sportspress' ) );
|
||||
sp_post_adder( 'sp_list', esc_attr__( 'Add New', 'sportspress' ) );
|
||||
endif;
|
||||
?>
|
||||
</p>
|
||||
|
||||
<p><label for="<?php echo $this->get_field_id( 'order' ); ?>"><?php _e( 'Sort Order:', 'sportspress' ); ?></label>
|
||||
<select name="<?php echo $this->get_field_name( 'order' ); ?>" id="<?php echo $this->get_field_id( 'order' ); ?>" class="sp-select-order widefat" <?php disabled( $orderby, 'default' ); ?>>
|
||||
<option value="ASC" <?php selected( 'ASC', $order ); ?>><?php _e( 'Ascending', 'sportspress' ); ?></option>
|
||||
<option value="DESC" <?php selected( 'DESC', $order ); ?>><?php _e( 'Descending', 'sportspress' ); ?></option>
|
||||
<p><label for="<?php echo esc_attr( $this->get_field_id( 'order' ) ); ?>"><?php esc_attr_e( 'Sort Order:', 'sportspress' ); ?></label>
|
||||
<select name="<?php echo esc_attr( $this->get_field_name( 'order' ) ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'order' ) ); ?>" class="sp-select-order widefat" <?php disabled( $orderby, 'default' ); ?>>
|
||||
<option value="ASC" <?php selected( 'ASC', $order ); ?>><?php esc_attr_e( 'Ascending', 'sportspress' ); ?></option>
|
||||
<option value="DESC" <?php selected( 'DESC', $order ); ?>><?php esc_attr_e( 'Descending', 'sportspress' ); ?></option>
|
||||
</select></p>
|
||||
|
||||
<p><input class="checkbox" type="checkbox" id="<?php echo $this->get_field_id( 'show_all_players_link' ); ?>" name="<?php echo $this->get_field_name( 'show_all_players_link' ); ?>" value="1" <?php checked( $show_all_players_link, 1 ); ?>>
|
||||
<label for="<?php echo $this->get_field_id( 'show_all_players_link' ); ?>"><?php _e( 'Display link to view all players', 'sportspress' ); ?></label></p>
|
||||
<p><input class="checkbox" type="checkbox" id="<?php echo esc_attr( $this->get_field_id( 'show_all_players_link' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'show_all_players_link' ) ); ?>" value="1" <?php checked( $show_all_players_link, 1 ); ?>>
|
||||
<label for="<?php echo esc_attr( $this->get_field_id( 'show_all_players_link' ) ); ?>"><?php esc_attr_e( 'Display link to view all players', 'sportspress' ); ?></label></p>
|
||||
|
||||
<?php
|
||||
// Action to hook into
|
||||
|
||||
@@ -4,9 +4,9 @@ class SP_Widget_Staff extends WP_Widget {
|
||||
function __construct() {
|
||||
$widget_ops = array(
|
||||
'classname' => 'widget_sportspress widget_staff widget_sp_staff',
|
||||
'description' => __( 'Display a single staff member.', 'sportspress' ),
|
||||
'description' => esc_attr__( 'Display a single staff member.', 'sportspress' ),
|
||||
);
|
||||
parent::__construct( 'sportspress-staff', __( 'Staff', 'sportspress' ), $widget_ops );
|
||||
parent::__construct( 'sportspress-staff', esc_attr__( 'Staff', 'sportspress' ), $widget_ops );
|
||||
}
|
||||
|
||||
function widget( $args, $instance ) {
|
||||
@@ -15,16 +15,16 @@ class SP_Widget_Staff extends WP_Widget {
|
||||
$id = empty( $instance['id'] ) ? null : $instance['id'];
|
||||
|
||||
do_action( 'sportspress_before_widget', $args, $instance, 'staff' );
|
||||
echo $before_widget;
|
||||
echo wp_kses_post( $before_widget );
|
||||
|
||||
if ( $title ) {
|
||||
echo $before_title . $title . $after_title;
|
||||
echo wp_kses_post( $before_title . $title . $after_title );
|
||||
}
|
||||
|
||||
// Action to hook into
|
||||
do_action( 'sportspress_before_widget_template', $args, $instance, 'staff' );
|
||||
|
||||
echo '<h4 class="sp-table-caption">' . get_the_title( $id ) . '</h4>';
|
||||
echo '<h4 class="sp-table-caption">' . wp_kses_post( get_the_title( $id ) ) . '</h4>';
|
||||
|
||||
sp_get_template( 'staff-photo.php', array( 'id' => $id ) );
|
||||
sp_get_template( 'staff-details.php', array( 'id' => $id ) );
|
||||
@@ -32,7 +32,7 @@ class SP_Widget_Staff extends WP_Widget {
|
||||
// Action to hook into
|
||||
do_action( 'sportspress_after_widget_template', $args, $instance, 'staff' );
|
||||
|
||||
echo $after_widget;
|
||||
echo wp_kses_post( $after_widget );
|
||||
do_action( 'sportspress_after_widget', $args, $instance, 'staff' );
|
||||
}
|
||||
|
||||
@@ -61,10 +61,10 @@ class SP_Widget_Staff extends WP_Widget {
|
||||
// Action to hook into
|
||||
do_action( 'sportspress_before_widget_template_form', $this, $instance, 'staff' );
|
||||
?>
|
||||
<p><label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', 'sportspress' ); ?></label>
|
||||
<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" /></p>
|
||||
<p><label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php esc_attr_e( 'Title:', 'sportspress' ); ?></label>
|
||||
<input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" /></p>
|
||||
|
||||
<p><label for="<?php echo $this->get_field_id( 'id' ); ?>"><?php printf( __( 'Select %s:', 'sportspress' ), __( 'Staff', 'sportspress' ) ); ?></label>
|
||||
<p><label for="<?php echo esc_attr( $this->get_field_id( 'id' ) ); ?>"><?php printf( esc_attr__( 'Select %s:', 'sportspress' ), esc_attr__( 'Staff', 'sportspress' ) ); ?></label>
|
||||
<?php
|
||||
$args = array(
|
||||
'post_type' => 'sp_staff',
|
||||
@@ -75,7 +75,7 @@ class SP_Widget_Staff extends WP_Widget {
|
||||
'class' => 'widefat',
|
||||
);
|
||||
if ( ! sp_dropdown_pages( $args ) ) :
|
||||
sp_post_adder( 'sp_staff', __( 'Add New', 'sportspress' ) );
|
||||
sp_post_adder( 'sp_staff', esc_attr__( 'Add New', 'sportspress' ) );
|
||||
endif;
|
||||
?>
|
||||
</p>
|
||||
|
||||
@@ -4,9 +4,9 @@ class SP_Widget_Team_Gallery extends WP_Widget {
|
||||
function __construct() {
|
||||
$widget_ops = array(
|
||||
'classname' => 'widget_sportspress widget_team_gallery widget_sp_team_gallery',
|
||||
'description' => __( 'Display a gallery of teams.', 'sportspress' ),
|
||||
'description' => esc_attr__( 'Display a gallery of teams.', 'sportspress' ),
|
||||
);
|
||||
parent::__construct( 'sportspress-team-gallery', __( 'Team Gallery', 'sportspress' ), $widget_ops );
|
||||
parent::__construct( 'sportspress-team-gallery', esc_attr__( 'Team Gallery', 'sportspress' ), $widget_ops );
|
||||
}
|
||||
|
||||
function widget( $args, $instance ) {
|
||||
@@ -33,10 +33,10 @@ class SP_Widget_Team_Gallery extends WP_Widget {
|
||||
$show_all_teams_link = empty( $instance['show_all_teams_link'] ) ? false : $instance['show_all_teams_link'];
|
||||
|
||||
do_action( 'sportspress_before_widget', $args, $instance, 'team-gallery' );
|
||||
echo $before_widget;
|
||||
echo wp_kses_post( $before_widget );
|
||||
|
||||
if ( $title ) {
|
||||
echo $before_title . $title . $after_title;
|
||||
echo wp_kses_post( $before_title . $title . $after_title );
|
||||
}
|
||||
|
||||
// Action to hook into
|
||||
@@ -58,7 +58,7 @@ class SP_Widget_Team_Gallery extends WP_Widget {
|
||||
// Action to hook into
|
||||
do_action( 'sportspress_after_widget_template', $args, $instance, 'team-gallery' );
|
||||
|
||||
echo $after_widget;
|
||||
echo wp_kses_post( $after_widget );
|
||||
do_action( 'sportspress_after_widget', $args, $instance, 'team-gallery' );
|
||||
}
|
||||
|
||||
@@ -102,13 +102,13 @@ class SP_Widget_Team_Gallery extends WP_Widget {
|
||||
// Action to hook into
|
||||
do_action( 'sportspress_before_widget_template_form', $this, $instance, 'team-gallery' );
|
||||
?>
|
||||
<p><label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', 'sportspress' ); ?></label>
|
||||
<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" /></p>
|
||||
<p><label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php esc_attr_e( 'Title:', 'sportspress' ); ?></label>
|
||||
<input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" /></p>
|
||||
|
||||
<p><label for="<?php echo $this->get_field_id( 'caption' ); ?>"><?php _e( 'Heading:', 'sportspress' ); ?></label>
|
||||
<input class="widefat" id="<?php echo $this->get_field_id( 'caption' ); ?>" name="<?php echo $this->get_field_name( 'caption' ); ?>" type="text" value="<?php echo esc_attr( $caption ); ?>" /></p>
|
||||
<p><label for="<?php echo esc_attr( $this->get_field_id( 'caption' ) ); ?>"><?php esc_attr_e( 'Heading:', 'sportspress' ); ?></label>
|
||||
<input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'caption' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'caption' ) ); ?>" type="text" value="<?php echo esc_attr( $caption ); ?>" /></p>
|
||||
|
||||
<p><label for="<?php echo $this->get_field_id( 'id' ); ?>"><?php printf( __( 'Select %s:', 'sportspress' ), __( 'League Table', 'sportspress' ) ); ?></label>
|
||||
<p><label for="<?php echo esc_attr( $this->get_field_id( 'id' ) ); ?>"><?php printf( esc_attr__( 'Select %s:', 'sportspress' ), esc_attr__( 'League Table', 'sportspress' ) ); ?></label>
|
||||
<?php
|
||||
$args = array(
|
||||
'post_type' => 'sp_table',
|
||||
@@ -119,26 +119,26 @@ class SP_Widget_Team_Gallery extends WP_Widget {
|
||||
'class' => 'widefat',
|
||||
);
|
||||
if ( ! sp_dropdown_pages( $args ) ) :
|
||||
sp_post_adder( 'sp_table', __( 'Add New', 'sportspress' ) );
|
||||
sp_post_adder( 'sp_table', esc_attr__( 'Add New', 'sportspress' ) );
|
||||
endif;
|
||||
?>
|
||||
</p>
|
||||
|
||||
<p><label for="<?php echo $this->get_field_id( 'number' ); ?>"><?php _e( 'Number of teams to show:', 'sportspress' ); ?></label>
|
||||
<input id="<?php echo $this->get_field_id( 'number' ); ?>" name="<?php echo $this->get_field_name( 'number' ); ?>" type="text" value="<?php echo esc_attr( $number ); ?>" size="3"></p>
|
||||
<p><label for="<?php echo esc_attr( $this->get_field_id( 'number' ) ); ?>"><?php esc_attr_e( 'Number of teams to show:', 'sportspress' ); ?></label>
|
||||
<input id="<?php echo esc_attr( $this->get_field_id( 'number' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'number' ) ); ?>" type="text" value="<?php echo esc_attr( $number ); ?>" size="3"></p>
|
||||
|
||||
<p><label for="<?php echo $this->get_field_id( 'columns' ); ?>"><?php _e( 'Columns:', 'sportspress' ); ?></label>
|
||||
<input id="<?php echo $this->get_field_id( 'columns' ); ?>" name="<?php echo $this->get_field_name( 'columns' ); ?>" type="text" value="<?php echo esc_attr( $columns ); ?>" size="3"></p>
|
||||
<p><label for="<?php echo esc_attr( $this->get_field_id( 'columns' ) ); ?>"><?php esc_attr_e( 'Columns:', 'sportspress' ); ?></label>
|
||||
<input id="<?php echo esc_attr( $this->get_field_id( 'columns' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'columns' ) ); ?>" type="text" value="<?php echo esc_attr( $columns ); ?>" size="3"></p>
|
||||
|
||||
<p><label for="<?php echo $this->get_field_id( 'orderby' ); ?>"><?php _e( 'Sort by:', 'sportspress' ); ?></label>
|
||||
<select id="<?php echo $this->get_field_id( 'orderby' ); ?>" name="<?php echo $this->get_field_name( 'orderby' ); ?>">
|
||||
<option value="default" <?php selected( 'default', $orderby ); ?>><?php _e( 'Rank', 'sportspress' ); ?></option>
|
||||
<option value="name" <?php selected( 'name', $orderby ); ?>><?php _e( 'Alphabetical', 'sportspress' ); ?></option>
|
||||
<option value="rand" <?php selected( 'rand', $orderby ); ?>><?php _e( 'Random', 'sportspress' ); ?></option>
|
||||
<p><label for="<?php echo esc_attr( $this->get_field_id( 'orderby' ) ); ?>"><?php esc_attr_e( 'Sort by:', 'sportspress' ); ?></label>
|
||||
<select id="<?php echo esc_attr( $this->get_field_id( 'orderby' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'orderby' ) ); ?>">
|
||||
<option value="default" <?php selected( 'default', $orderby ); ?>><?php esc_attr_e( 'Rank', 'sportspress' ); ?></option>
|
||||
<option value="name" <?php selected( 'name', $orderby ); ?>><?php esc_attr_e( 'Alphabetical', 'sportspress' ); ?></option>
|
||||
<option value="rand" <?php selected( 'rand', $orderby ); ?>><?php esc_attr_e( 'Random', 'sportspress' ); ?></option>
|
||||
</select></p>
|
||||
|
||||
<p><input class="checkbox" type="checkbox" id="<?php echo $this->get_field_id( 'show_all_teams_link' ); ?>" name="<?php echo $this->get_field_name( 'show_all_teams_link' ); ?>" value="1" <?php checked( $show_all_teams_link, 1 ); ?>>
|
||||
<label for="<?php echo $this->get_field_id( 'show_all_teams_link' ); ?>"><?php _e( 'Display link to view all teams', 'sportspress' ); ?></label></p>
|
||||
<p><input class="checkbox" type="checkbox" id="<?php echo esc_attr( $this->get_field_id( 'show_all_teams_link' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'show_all_teams_link' ) ); ?>" value="1" <?php checked( $show_all_teams_link, 1 ); ?>>
|
||||
<label for="<?php echo esc_attr( $this->get_field_id( 'show_all_teams_link' ) ); ?>"><?php esc_attr_e( 'Display link to view all teams', 'sportspress' ); ?></label></p>
|
||||
|
||||
<?php
|
||||
// Action to hook into
|
||||
|
||||
Reference in New Issue
Block a user