Use global linking options per post type
This commit is contained in:
@@ -5,7 +5,7 @@
|
|||||||
* @author ThemeBoy
|
* @author ThemeBoy
|
||||||
* @category Admin
|
* @category Admin
|
||||||
* @package SportsPress/Admin
|
* @package SportsPress/Admin
|
||||||
* @version 1.1
|
* @version 1.3
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||||
@@ -40,6 +40,23 @@ class SP_Settings_Events extends SP_Settings_Page {
|
|||||||
return apply_filters( 'sportspress_event_settings', array(
|
return apply_filters( 'sportspress_event_settings', array(
|
||||||
|
|
||||||
array( 'title' => __( 'Event Options', 'sportspress' ), 'type' => 'title','desc' => '', 'id' => 'event_options' ),
|
array( 'title' => __( 'Event Options', 'sportspress' ), 'type' => 'title','desc' => '', 'id' => 'event_options' ),
|
||||||
|
|
||||||
|
array(
|
||||||
|
'title' => __( 'Link', 'sportspress' ),
|
||||||
|
'desc' => __( 'Link events', 'sportspress' ),
|
||||||
|
'id' => 'sportspress_link_events',
|
||||||
|
'default' => 'yes',
|
||||||
|
'type' => 'checkbox',
|
||||||
|
'checkboxgroup' => 'start',
|
||||||
|
),
|
||||||
|
|
||||||
|
array(
|
||||||
|
'desc' => __( 'Link venues', 'sportspress' ),
|
||||||
|
'id' => 'sportspress_link_venues',
|
||||||
|
'default' => 'no',
|
||||||
|
'type' => 'checkbox',
|
||||||
|
'checkboxgroup' => 'end',
|
||||||
|
),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'title' => __( 'Limit', 'sportspress' ),
|
'title' => __( 'Limit', 'sportspress' ),
|
||||||
@@ -73,14 +90,6 @@ class SP_Settings_Events extends SP_Settings_Page {
|
|||||||
'checkboxgroup' => 'start',
|
'checkboxgroup' => 'start',
|
||||||
),
|
),
|
||||||
|
|
||||||
array(
|
|
||||||
'desc' => __( 'Link venues', 'sportspress' ),
|
|
||||||
'id' => 'sportspress_event_link_venues',
|
|
||||||
'default' => 'no',
|
|
||||||
'type' => 'checkbox',
|
|
||||||
'checkboxgroup' => 'end',
|
|
||||||
),
|
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'title' => __( 'Player Performance', 'sportspress' ),
|
'title' => __( 'Player Performance', 'sportspress' ),
|
||||||
'desc' => __( 'Display players', 'sportspress' ),
|
'desc' => __( 'Display players', 'sportspress' ),
|
||||||
@@ -90,14 +99,6 @@ class SP_Settings_Events extends SP_Settings_Page {
|
|||||||
'checkboxgroup' => 'start',
|
'checkboxgroup' => 'start',
|
||||||
),
|
),
|
||||||
|
|
||||||
array(
|
|
||||||
'desc' => __( 'Link players', 'sportspress' ),
|
|
||||||
'id' => 'sportspress_event_link_players',
|
|
||||||
'default' => 'yes',
|
|
||||||
'type' => 'checkbox',
|
|
||||||
'checkboxgroup' => '',
|
|
||||||
),
|
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'desc' => __( 'Display total', 'sportspress' ),
|
'desc' => __( 'Display total', 'sportspress' ),
|
||||||
'id' => 'sportspress_event_show_total',
|
'id' => 'sportspress_event_show_total',
|
||||||
@@ -115,34 +116,10 @@ class SP_Settings_Events extends SP_Settings_Page {
|
|||||||
'checkboxgroup' => 'start',
|
'checkboxgroup' => 'start',
|
||||||
),
|
),
|
||||||
|
|
||||||
array(
|
|
||||||
'desc' => __( 'Link staff', 'sportspress' ),
|
|
||||||
'id' => 'sportspress_event_link_staff',
|
|
||||||
'default' => 'yes',
|
|
||||||
'type' => 'checkbox',
|
|
||||||
'checkboxgroup' => 'end',
|
|
||||||
),
|
|
||||||
|
|
||||||
array( 'type' => 'sectionend', 'id' => 'event_options' ),
|
array( 'type' => 'sectionend', 'id' => 'event_options' ),
|
||||||
|
|
||||||
array( 'title' => __( 'Calendars', 'sportspress' ), 'type' => 'title', 'id' => 'calendar_options' ),
|
array( 'title' => __( 'Calendars', 'sportspress' ), 'type' => 'title', 'id' => 'calendar_options' ),
|
||||||
|
|
||||||
array(
|
|
||||||
'title' => __( 'Teams', 'sportspress' ),
|
|
||||||
'desc' => __( 'Link teams', 'sportspress' ),
|
|
||||||
'id' => 'sportspress_calendar_link_teams',
|
|
||||||
'default' => 'no',
|
|
||||||
'type' => 'checkbox',
|
|
||||||
),
|
|
||||||
|
|
||||||
array(
|
|
||||||
'title' => __( 'Venues', 'sportspress' ),
|
|
||||||
'desc' => __( 'Link venues', 'sportspress' ),
|
|
||||||
'id' => 'sportspress_calendar_link_venues',
|
|
||||||
'default' => 'yes',
|
|
||||||
'type' => 'checkbox',
|
|
||||||
),
|
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'title' => __( 'Pagination', 'sportspress' ),
|
'title' => __( 'Pagination', 'sportspress' ),
|
||||||
'desc' => __( 'Paginate', 'sportspress' ),
|
'desc' => __( 'Paginate', 'sportspress' ),
|
||||||
|
|||||||
@@ -38,6 +38,14 @@ class SP_Settings_Players extends SP_Settings_Page {
|
|||||||
$settings = array(
|
$settings = array(
|
||||||
array( 'title' => __( 'Player Options', 'sportspress' ), 'type' => 'title','desc' => '', 'id' => 'player_options' ),
|
array( 'title' => __( 'Player Options', 'sportspress' ), 'type' => 'title','desc' => '', 'id' => 'player_options' ),
|
||||||
|
|
||||||
|
array(
|
||||||
|
'title' => __( 'Link', 'sportspress' ),
|
||||||
|
'desc' => __( 'Link players', 'sportspress' ),
|
||||||
|
'id' => 'sportspress_link_players',
|
||||||
|
'default' => 'yes',
|
||||||
|
'type' => 'checkbox',
|
||||||
|
),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'title' => __( 'Nationality', 'sportspress' ),
|
'title' => __( 'Nationality', 'sportspress' ),
|
||||||
'desc' => __( 'Display national flags', 'sportspress' ),
|
'desc' => __( 'Display national flags', 'sportspress' ),
|
||||||
@@ -50,22 +58,6 @@ class SP_Settings_Players extends SP_Settings_Page {
|
|||||||
|
|
||||||
array( 'title' => __( 'Player Lists', 'sportspress' ), 'type' => 'title', 'id' => 'list_options' ),
|
array( 'title' => __( 'Player Lists', 'sportspress' ), 'type' => 'title', 'id' => 'list_options' ),
|
||||||
|
|
||||||
array(
|
|
||||||
'title' => __( 'Players', 'sportspress' ),
|
|
||||||
'desc' => __( 'Link players', 'sportspress' ),
|
|
||||||
'id' => 'sportspress_list_link_players',
|
|
||||||
'default' => 'yes',
|
|
||||||
'type' => 'checkbox',
|
|
||||||
),
|
|
||||||
|
|
||||||
array(
|
|
||||||
'title' => __( 'Teams', 'sportspress' ),
|
|
||||||
'desc' => __( 'Link teams', 'sportspress' ),
|
|
||||||
'id' => 'sportspress_list_link_teams',
|
|
||||||
'default' => 'no',
|
|
||||||
'type' => 'checkbox',
|
|
||||||
),
|
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'title' => __( 'Pagination', 'sportspress' ),
|
'title' => __( 'Pagination', 'sportspress' ),
|
||||||
'desc' => __( 'Paginate', 'sportspress' ),
|
'desc' => __( 'Paginate', 'sportspress' ),
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
* @author ThemeBoy
|
* @author ThemeBoy
|
||||||
* @category Admin
|
* @category Admin
|
||||||
* @package SportsPress/Admin
|
* @package SportsPress/Admin
|
||||||
* @version 1.1
|
* @version 1.3
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||||
@@ -40,6 +40,14 @@ class SP_Settings_Staff extends SP_Settings_Page {
|
|||||||
|
|
||||||
array( 'title' => __( 'Staff Options', 'sportspress' ), 'type' => 'title','desc' => '', 'id' => 'staff_options' ),
|
array( 'title' => __( 'Staff Options', 'sportspress' ), 'type' => 'title','desc' => '', 'id' => 'staff_options' ),
|
||||||
|
|
||||||
|
array(
|
||||||
|
'title' => __( 'Link', 'sportspress' ),
|
||||||
|
'desc' => __( 'Link staff', 'sportspress' ),
|
||||||
|
'id' => 'sportspress_link_staff',
|
||||||
|
'default' => 'yes',
|
||||||
|
'type' => 'checkbox',
|
||||||
|
),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'title' => __( 'Nationality', 'sportspress' ),
|
'title' => __( 'Nationality', 'sportspress' ),
|
||||||
'desc' => __( 'Display national flags', 'sportspress' ),
|
'desc' => __( 'Display national flags', 'sportspress' ),
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
* @author ThemeBoy
|
* @author ThemeBoy
|
||||||
* @category Admin
|
* @category Admin
|
||||||
* @package SportsPress/Admin
|
* @package SportsPress/Admin
|
||||||
* @version 0.8
|
* @version 1.3
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||||
@@ -40,6 +40,14 @@ class SP_Settings_Teams extends SP_Settings_Page {
|
|||||||
|
|
||||||
array( 'title' => __( 'Team Options', 'sportspress' ), 'type' => 'title','desc' => '', 'id' => 'team_options' ),
|
array( 'title' => __( 'Team Options', 'sportspress' ), 'type' => 'title','desc' => '', 'id' => 'team_options' ),
|
||||||
|
|
||||||
|
array(
|
||||||
|
'title' => __( 'Link', 'sportspress' ),
|
||||||
|
'desc' => __( 'Link teams', 'sportspress' ),
|
||||||
|
'id' => 'sportspress_link_teams',
|
||||||
|
'default' => 'no',
|
||||||
|
'type' => 'checkbox',
|
||||||
|
),
|
||||||
|
|
||||||
array( 'type' => 'sectionend', 'id' => 'team_options' ),
|
array( 'type' => 'sectionend', 'id' => 'team_options' ),
|
||||||
|
|
||||||
array( 'title' => __( 'League Tables', 'sportspress' ), 'type' => 'title', 'id' => 'table_options' ),
|
array( 'title' => __( 'League Tables', 'sportspress' ), 'type' => 'title', 'id' => 'table_options' ),
|
||||||
@@ -50,15 +58,6 @@ class SP_Settings_Teams extends SP_Settings_Page {
|
|||||||
'id' => 'sportspress_table_show_logos',
|
'id' => 'sportspress_table_show_logos',
|
||||||
'default' => 'yes',
|
'default' => 'yes',
|
||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
'checkboxgroup' => 'start',
|
|
||||||
),
|
|
||||||
|
|
||||||
array(
|
|
||||||
'desc' => __( 'Link teams', 'sportspress' ),
|
|
||||||
'id' => 'sportspress_table_link_teams',
|
|
||||||
'default' => 'no',
|
|
||||||
'type' => 'checkbox',
|
|
||||||
'checkboxgroup' => 'end',
|
|
||||||
),
|
),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
|
|||||||
@@ -280,7 +280,7 @@ class SP_Player extends SP_Custom_Post {
|
|||||||
|
|
||||||
$team_name = get_the_title( $team_id );
|
$team_name = get_the_title( $team_id );
|
||||||
|
|
||||||
if ( get_option( 'sportspress_player_link_teams', 'no' ) == 'yes' ? true : false ):
|
if ( get_option( 'sportspress_link_teams', 'no' ) == 'yes' ? true : false ):
|
||||||
$team_permalink = get_permalink( $team_id );
|
$team_permalink = get_permalink( $team_id );
|
||||||
$team_name = '<a href="' . $team_permalink . '">' . $team_name . '</a>';
|
$team_name = '<a href="' . $team_permalink . '">' . $team_name . '</a>';
|
||||||
endif;
|
endif;
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ $defaults = array(
|
|||||||
'status' => 'default',
|
'status' => 'default',
|
||||||
'date' => 'default',
|
'date' => 'default',
|
||||||
'number' => -1,
|
'number' => -1,
|
||||||
'link_teams' => get_option( 'sportspress_calendar_link_teams', 'no' ) == 'yes' ? true : false,
|
'link_teams' => get_option( 'sportspress_link_teams', 'no' ) == 'yes' ? true : false,
|
||||||
'paginated' => get_option( 'sportspress_calendar_paginated', 'yes' ) == 'yes' ? true : false,
|
'paginated' => get_option( 'sportspress_calendar_paginated', 'yes' ) == 'yes' ? true : false,
|
||||||
'rows' => get_option( 'sportspress_calendar_rows', 10 ),
|
'rows' => get_option( 'sportspress_calendar_rows', 10 ),
|
||||||
'order' => 'default',
|
'order' => 'default',
|
||||||
|
|||||||
@@ -16,8 +16,8 @@ $defaults = array(
|
|||||||
'status' => 'default',
|
'status' => 'default',
|
||||||
'date' => 'default',
|
'date' => 'default',
|
||||||
'number' => -1,
|
'number' => -1,
|
||||||
'link_teams' => get_option( 'sportspress_calendar_link_teams', 'no' ) == 'yes' ? true : false,
|
'link_teams' => get_option( 'sportspress_link_teams', 'no' ) == 'yes' ? true : false,
|
||||||
'link_venues' => get_option( 'sportspress_calendar_link_venues', 'yes' ) == 'yes' ? true : false,
|
'link_venues' => get_option( 'sportspress_link_venues', 'yes' ) == 'yes' ? true : false,
|
||||||
'sortable' => get_option( 'sportspress_enable_sortable_tables', 'yes' ) == 'yes' ? true : false,
|
'sortable' => get_option( 'sportspress_enable_sortable_tables', 'yes' ) == 'yes' ? true : false,
|
||||||
'scrollable' => get_option( 'sportspress_enable_scrollable_tables', 'yes' ) == 'yes' ? true : false,
|
'scrollable' => get_option( 'sportspress_enable_scrollable_tables', 'yes' ) == 'yes' ? true : false,
|
||||||
'responsive' => get_option( 'sportspress_enable_responsive_tables', 'yes' ) == 'yes' ? true : false,
|
'responsive' => get_option( 'sportspress_enable_responsive_tables', 'yes' ) == 'yes' ? true : false,
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ $teams = get_post_meta( $id, 'sp_team', false );
|
|||||||
$status = $event->status();
|
$status = $event->status();
|
||||||
|
|
||||||
$show_players = get_option( 'sportspress_event_show_players', 'yes' ) == 'yes' ? true : false;
|
$show_players = get_option( 'sportspress_event_show_players', 'yes' ) == 'yes' ? true : false;
|
||||||
$link_posts = get_option( 'sportspress_event_link_players', 'yes' ) == 'yes' ? true : false;
|
$link_posts = get_option( 'sportspress_link_players', 'yes' ) == 'yes' ? true : false;
|
||||||
$sortable = get_option( 'sportspress_enable_sortable_tables', 'yes' ) == 'yes' ? true : false;
|
$sortable = get_option( 'sportspress_enable_sortable_tables', 'yes' ) == 'yes' ? true : false;
|
||||||
$scrollable = get_option( 'sportspress_enable_scrollable_tables', 'yes' ) == 'yes' ? true : false;
|
$scrollable = get_option( 'sportspress_enable_scrollable_tables', 'yes' ) == 'yes' ? true : false;
|
||||||
$responsive = get_option( 'sportspress_enable_responsive_tables', 'yes' ) == 'yes' ? true : false;
|
$responsive = get_option( 'sportspress_enable_responsive_tables', 'yes' ) == 'yes' ? true : false;
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
|||||||
$defaults = array(
|
$defaults = array(
|
||||||
'id' => get_the_ID(),
|
'id' => get_the_ID(),
|
||||||
'index' => 0,
|
'index' => 0,
|
||||||
'link_posts' => get_option( 'sportspress_event_link_staff', 'yes' ) == 'yes' ? true : false,
|
'link_posts' => get_option( 'sportspress_link_staff', 'yes' ) == 'yes' ? true : false,
|
||||||
);
|
);
|
||||||
|
|
||||||
$staff = array_filter( sp_array_between( (array)get_post_meta( $id, 'sp_staff', false ), 0, $index ) );
|
$staff = array_filter( sp_array_between( (array)get_post_meta( $id, 'sp_staff', false ), 0, $index ) );
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ if ( ! $venues )
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
$show_maps = get_option( 'sportspress_event_show_maps', 'yes' ) == 'yes' ? true : false;
|
$show_maps = get_option( 'sportspress_event_show_maps', 'yes' ) == 'yes' ? true : false;
|
||||||
$link_venues = get_option( 'sportspress_event_link_venues', 'no' ) == 'yes' ? true : false;
|
$link_venues = get_option( 'sportspress_link_venues', 'no' ) == 'yes' ? true : false;
|
||||||
|
|
||||||
foreach( $venues as $venue ):
|
foreach( $venues as $venue ):
|
||||||
$t_id = $venue->term_id;
|
$t_id = $venue->term_id;
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ $defaults = array(
|
|||||||
'columns' => null,
|
'columns' => null,
|
||||||
'show_full_table_link' => false,
|
'show_full_table_link' => false,
|
||||||
'show_team_logo' => get_option( 'sportspress_table_show_logos', 'yes' ) == 'yes' ? true : false,
|
'show_team_logo' => get_option( 'sportspress_table_show_logos', 'yes' ) == 'yes' ? true : false,
|
||||||
'link_posts' => get_option( 'sportspress_table_link_teams', 'no' ) == 'yes' ? true : false,
|
'link_posts' => get_option( 'sportspress_link_teams', 'no' ) == 'yes' ? true : false,
|
||||||
'sortable' => get_option( 'sportspress_enable_sortable_tables', 'yes' ) == 'yes' ? true : false,
|
'sortable' => get_option( 'sportspress_enable_sortable_tables', 'yes' ) == 'yes' ? true : false,
|
||||||
'scrollable' => get_option( 'sportspress_enable_scrollable_tables', 'yes' ) == 'yes' ? true : false,
|
'scrollable' => get_option( 'sportspress_enable_scrollable_tables', 'yes' ) == 'yes' ? true : false,
|
||||||
'responsive' => get_option( 'sportspress_enable_responsive_tables', 'yes' ) == 'yes' ? true : false,
|
'responsive' => get_option( 'sportspress_enable_responsive_tables', 'yes' ) == 'yes' ? true : false,
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ $defaults = array(
|
|||||||
'captiontag' => 'dd',
|
'captiontag' => 'dd',
|
||||||
'caption' => null,
|
'caption' => null,
|
||||||
'size' => 'thumbnail',
|
'size' => 'thumbnail',
|
||||||
'link_posts' => get_option( 'sportspress_list_link_players', 'yes' ) == 'yes' ? true : false,
|
'link_posts' => get_option( 'sportspress_link_players', 'yes' ) == 'yes' ? true : false,
|
||||||
);
|
);
|
||||||
|
|
||||||
extract( $defaults, EXTR_SKIP );
|
extract( $defaults, EXTR_SKIP );
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ $defaults = array(
|
|||||||
'columns' => 3,
|
'columns' => 3,
|
||||||
'size' => 'thumbnail',
|
'size' => 'thumbnail',
|
||||||
'show_all_players_link' => false,
|
'show_all_players_link' => false,
|
||||||
'link_posts' => get_option( 'sportspress_list_link_players', 'yes' ) == 'yes' ? true : false,
|
'link_posts' => get_option( 'sportspress_link_players', 'yes' ) == 'yes' ? true : false,
|
||||||
);
|
);
|
||||||
|
|
||||||
extract( $defaults, EXTR_SKIP );
|
extract( $defaults, EXTR_SKIP );
|
||||||
|
|||||||
@@ -18,8 +18,8 @@ $defaults = array(
|
|||||||
'orderby' => 'default',
|
'orderby' => 'default',
|
||||||
'order' => 'ASC',
|
'order' => 'ASC',
|
||||||
'show_all_players_link' => false,
|
'show_all_players_link' => false,
|
||||||
'link_posts' => get_option( 'sportspress_list_link_players', 'yes' ) == 'yes' ? true : false,
|
'link_posts' => get_option( 'sportspress_link_players', 'yes' ) == 'yes' ? true : false,
|
||||||
'link_teams' => get_option( 'sportspress_list_link_teams', 'no' ) == 'yes' ? true : false,
|
'link_teams' => get_option( 'sportspress_link_teams', 'no' ) == 'yes' ? true : false,
|
||||||
'sortable' => get_option( 'sportspress_enable_sortable_tables', 'yes' ) == 'yes' ? true : false,
|
'sortable' => get_option( 'sportspress_enable_sortable_tables', 'yes' ) == 'yes' ? true : false,
|
||||||
'scrollable' => get_option( 'sportspress_enable_scrollable_tables', 'yes' ) == 'yes' ? true : false,
|
'scrollable' => get_option( 'sportspress_enable_scrollable_tables', 'yes' ) == 'yes' ? true : false,
|
||||||
'responsive' => get_option( 'sportspress_enable_responsive_tables', 'yes' ) == 'yes' ? true : false,
|
'responsive' => get_option( 'sportspress_enable_responsive_tables', 'yes' ) == 'yes' ? true : false,
|
||||||
|
|||||||
Reference in New Issue
Block a user