diff --git a/admin/hooks/admin-head.php b/admin/hooks/admin-head.php deleted file mode 100644 index 7c908c76..00000000 --- a/admin/hooks/admin-head.php +++ /dev/null @@ -1,17 +0,0 @@ -add_cap( 'read_' . $post_type ); - $administrator->add_cap( 'edit_' . $post_type ); - $administrator->add_cap( 'delete_' . $post_type ); - foreach ( $caps as $cap ): - $administrator->add_cap( $cap . '_' . $post_type . 's' ); - endforeach; - endforeach; - - $administrator->add_cap( 'view_sportspress_reports' ); -} -add_action( 'admin_init', 'sportspress_admin_init' ); diff --git a/admin/hooks/admin-menu.php b/admin/hooks/admin-menu.php deleted file mode 100644 index 9a0fc1d3..00000000 --- a/admin/hooks/admin-menu.php +++ /dev/null @@ -1,66 +0,0 @@ - $data ): - if ( is_array( $data ) && array_key_exists( 2, $data ) && $data[2] == 'edit.php?post_type=sp_separator' ) - $separator_position = $key; - endforeach; - - // Swap our separator post type with a menu separator - if ( isset( $separator_position ) ): - $menu[ $separator_position ] = array( '', 'read', 'separator-sportspress', '', 'wp-menu-separator sportspress' ); - endif; - - // Remove "Venues" and "Positions" links from Media submenu - if ( isset( $submenu['upload.php'] ) ): - $submenu['upload.php'] = array_filter( $submenu['upload.php'], 'sportspress_admin_menu_remove_venues' ); - $submenu['upload.php'] = array_filter( $submenu['upload.php'], 'sportspress_admin_menu_remove_positions' ); - endif; - - // Remove "Leagues" and "Seasons" links from Schedule submenu - if ( isset( $submenu['edit.php?post_type=sp_event'] ) ): - $submenu['edit.php?post_type=sp_event'] = array_filter( $submenu['edit.php?post_type=sp_event'], 'sportspress_admin_menu_remove_leagues' ); - $submenu['edit.php?post_type=sp_event'] = array_filter( $submenu['edit.php?post_type=sp_event'], 'sportspress_admin_menu_remove_seasons' ); - endif; - - // Remove "Leagues" and "Seasons" links from Players submenu - if ( isset( $submenu['edit.php?post_type=sp_player'] ) ): - $submenu['edit.php?post_type=sp_player'] = array_filter( $submenu['edit.php?post_type=sp_player'], 'sportspress_admin_menu_remove_leagues' ); - $submenu['edit.php?post_type=sp_player'] = array_filter( $submenu['edit.php?post_type=sp_player'], 'sportspress_admin_menu_remove_seasons' ); - endif; - -} -add_action( 'admin_menu', 'sportspress_admin_menu' ); - -if ( ! function_exists( 'sportspress_admin_menu_remove_add_new' ) ) { - function sportspress_admin_menu_remove_add_new( $arr = array() ) { - return $arr[0] != __( 'Add New', 'sportspress' ); - } -} - -if ( ! function_exists( 'sportspress_admin_menu_remove_leagues' ) ) { - function sportspress_admin_menu_remove_leagues( $arr = array() ) { - return $arr[0] != __( 'Leagues', 'sportspress' ); - } -} - -if ( ! function_exists( 'sportspress_admin_menu_remove_positions' ) ) { - function sportspress_admin_menu_remove_positions( $arr = array() ) { - return $arr[0] != __( 'Positions', 'sportspress' ); - } -} - -if ( ! function_exists( 'sportspress_admin_menu_remove_seasons' ) ) { - function sportspress_admin_menu_remove_seasons( $arr = array() ) { - return $arr[0] != __( 'Seasons', 'sportspress' ); - } -} - -if ( ! function_exists( 'sportspress_admin_menu_remove_venues' ) ) { - function sportspress_admin_menu_remove_venues( $arr = array() ) { - return $arr[0] != __( 'Venues', 'sportspress' ); - } -} diff --git a/admin/hooks/admin-post-thumbnail-html.php b/admin/hooks/admin-post-thumbnail-html.php deleted file mode 100644 index 0d25f9a3..00000000 --- a/admin/hooks/admin-post-thumbnail-html.php +++ /dev/null @@ -1,26 +0,0 @@ - array( - 'Set featured image' => sprintf( __( 'Select %s', 'sportspress' ), __( 'Logo', 'sportspress' ) ), - 'Remove featured image' => sprintf( __( 'Remove %s', 'sportspress' ), __( 'Logo', 'sportspress' ) ), - ), - 'sp_player' => array( - 'Set featured image' => sprintf( __( 'Select %s', 'sportspress' ), __( 'Photo', 'sportspress' ) ), - 'Remove featured image' => sprintf( __( 'Remove %s', 'sportspress' ), __( 'Photo', 'sportspress' ) ), - ), - 'sp_staff' => array( - 'Set featured image' => sprintf( __( 'Select %s', 'sportspress' ), __( 'Photo', 'sportspress' ) ), - 'Remove featured image' => sprintf( __( 'Remove %s', 'sportspress' ), __( 'Photo', 'sportspress' ) ), - ), - ); - - $typenow = get_post_type( $post_id ); - if ( is_admin() && array_key_exists( $typenow, $texts ) ): - foreach ( $texts[ $typenow ] as $key => $value ): - $translated_text = str_replace( __( $key ), $value, $translated_text ); - endforeach; - endif; - return $translated_text; -} -add_filter( 'admin_post_thumbnail_html', 'sportspress_admin_post_thumbnail_html', 10, 2 ); diff --git a/admin/hooks/admin-print-styles.php b/admin/hooks/admin-print-styles.php deleted file mode 100644 index 4e698831..00000000 --- a/admin/hooks/admin-print-styles.php +++ /dev/null @@ -1,48 +0,0 @@ -id != 'settings_page_sportspress' ): - if ( isset( $_REQUEST['sportspress_installed'] ) ): - update_option( 'sportspress_installed', $_REQUEST['sportspress_installed'] ); - endif; - - if ( ! get_option( 'sportspress_installed' ) ): - add_action( 'admin_notices', 'sportspress_admin_install_notices' ); - endif; - endif; - - $template = get_option( 'template' ); - - if ( ! current_theme_supports( 'sportspress' ) && ! in_array( $template, array( 'twentyfourteen', 'twentythirteen', 'twentyeleven', 'twentytwelve', 'twentyten' ) ) ): - if ( ! empty( $_GET['hide_sportspress_theme_support_check'] ) ): - update_option( 'sportspress_theme_support_check', $template ); - return; - endif; - - if ( get_option( 'sportspress_theme_support_check' ) !== $template ): - add_action( 'admin_notices', 'sportspress_theme_check_notice' ); - endif; - endif; -} -add_action( 'admin_print_styles', 'sportspress_admin_notices_styles' ); - -/** - * sportspress_admin_install_notices function. - * - * @access public - * @return void - */ -function sportspress_admin_install_notices() { -// include( dirname( SP_PLUGIN_FILE ) . '/includes/admin/views/notice-install.php' ); -} - -/** - * sportspress_theme_check_notice function. - * - * @access public - * @return void - */ -function sportspress_theme_check_notice() { -// include( dirname( SP_PLUGIN_FILE ) . '/includes/admin/views/notice-theme-support.php' ); -} diff --git a/admin/hooks/gettext.php b/admin/hooks/gettext.php deleted file mode 100644 index 472cae37..00000000 --- a/admin/hooks/gettext.php +++ /dev/null @@ -1,84 +0,0 @@ -immediately': - $translated_text = __( 'Date/Time:', 'sportspress' ) . ' ' . __( 'Now', 'sportspress' ) . ''; - break; - case 'Author': - $translated_text = __( 'User', 'sportspress' ); - break; - endswitch; - endif; - - if ( in_array( $typenow, array( 'sp_team' ) ) ): - switch ( $untranslated_text ): - case 'Enter title here': - $translated_text = __( 'Team', 'sportspress' ); - break; - endswitch; - endif; - - if ( in_array( $typenow, array( 'sp_player', 'sp_staff' ) ) ): - switch ( $untranslated_text ): - case 'Featured Image': - $translated_text = __( 'Photo', 'sportspress' ); - break; - case 'Set featured image': - $translated_text = __( 'Select Photo', 'sportspress' ); - break; - case 'Set Featured Image': - $translated_text = __( 'Select Photo', 'sportspress' ); - break; - case 'Remove featured image': - $translated_text = __( 'Remove Photo', 'sportspress' ); - break; - endswitch; - endif; - else: - if ( $untranslated_text == 'Archives' && is_tax( 'sp_venue' ) ): - $slug = get_query_var( 'sp_venue' ); - if ( $slug ): - $venue = get_term_by( 'slug', $slug, 'sp_venue' ); - $translated_text = $venue->name; - endif; - endif; - if ( isset( $sportspress_options['text'] ) ): - foreach( $sportspress_options['text'] as $key => $value ): - if ( $translated_text == $key ): - $translated_text = $value; - endif; - endforeach; - endif; - endif; - - return $translated_text; -} -add_filter( 'gettext', 'sportspress_gettext', 20, 3 ); diff --git a/admin/hooks/loop-start.php b/admin/hooks/loop-start.php deleted file mode 100644 index 86c3b131..00000000 --- a/admin/hooks/loop-start.php +++ /dev/null @@ -1,21 +0,0 @@ -query, 'sp_venue', null ); - - if ( ! $slug ) - return; - - $venue = get_term_by( 'slug', $slug, 'sp_venue' ); - $t_id = $venue->term_id; - $venue_meta = get_option( "taxonomy_$t_id" ); - $address = sportspress_array_value( $venue_meta, 'sp_address', null ); - $latitude = sportspress_array_value( $venue_meta, 'sp_latitude', null ); - $longitude = sportspress_array_value( $venue_meta, 'sp_longitude', null ); - - if ( $latitude != null && $longitude != null ) - echo '
'; -} -add_action( 'loop_start', 'sportspress_default_venue_content' ); diff --git a/admin/hooks/manage-posts-columns.php b/admin/hooks/manage-posts-columns.php deleted file mode 100644 index 58f56456..00000000 --- a/admin/hooks/manage-posts-columns.php +++ /dev/null @@ -1,143 +0,0 @@ -'; - break; - case 'friendly': - echo ''; - break; - endswitch; - break; - case 'sp_icon': - edit_post_link( get_the_post_thumbnail( $post_id, 'sportspress-fit-icon' ), '', '', $post_id ); - break; - case 'sp_number': - $number = get_post_meta( $post_id, 'sp_number', true ); - if ( $number != null ): - echo '' . $number . ''; - endif; - break; - case 'sp_views': - echo sportspress_get_post_views( $post_id ); - break; - case 'sp_position': - echo get_the_terms( $post_id, 'sp_position' ) ? the_terms( $post_id, 'sp_position' ) : '—'; - break; - case 'sp_positions': - echo get_the_terms( $post_id, 'sp_position' ) ? the_terms( $post_id, 'sp_position' ) : '—'; - break; - case 'sp_team': - $post_type = get_post_type( $post ); - $teams = (array)get_post_meta( $post_id, 'sp_team', false ); - $teams = array_filter( $teams ); - if ( empty( $teams ) ): - echo '—'; - break; - elseif ( $post_type == 'sp_event' ): - $results = get_post_meta( $post_id, 'sp_results', true ); - global $sportspress_options; - $main_result = sportspress_array_value( $sportspress_options, 'main_result', null ); - foreach( $teams as $team_id ): - if ( ! $team_id ) continue; - $team = get_post( $team_id ); - - if ( $team ): - $team_results = sportspress_array_value( $results, $team_id, null ); - - if ( $main_result ): - $team_result = sportspress_array_value( $team_results, $main_result, null ); - else: - if ( is_array( $team_results ) ): - end( $team_results ); - $team_result = prev( $team_results ); - else: - $team_result = null; - endif; - endif; - - if ( $team_result != null ): - unset( $team_results['outcome'] ); - $team_results = implode( ' | ', $team_results ); - echo '' . $team_result . ' '; - endif; - - echo $team->post_title; - - echo '+ +
+ + id = 'account'; - $this->label = __( 'Accounts', 'sportspress' ); - - add_filter( 'sportspress_settings_tabs_array', array( $this, 'add_settings_page' ), 20 ); - add_action( 'sportspress_settings_' . $this->id, array( $this, 'output' ) ); - add_action( 'sportspress_settings_save_' . $this->id, array( $this, 'save' ) ); - } - - /** - * Get settings array - * - * @return array - */ - public function get_settings() { - - return apply_filters( 'sportspress_' . $this->id . '_settings', array( - - array( 'title' => __( 'Account Pages', 'sportspress' ), 'type' => 'title', 'desc' => __( 'These pages need to be set so that SportsPress knows where to send users to access account related functionality.', 'sportspress' ), 'id' => 'account_page_options' ), - - array( - 'title' => __( 'My Account Page', 'sportspress' ), - 'desc' => __( 'Page contents:', 'sportspress' ) . ' [' . apply_filters( 'sportspress_my_account_shortcode_tag', 'sportspress_my_account' ) . ']', - 'id' => 'sportspress_myaccount_page_id', - 'type' => 'single_select_page', - 'default' => '', - 'class' => 'chosen_select_nostd', - 'css' => 'min-width:300px;', - 'desc_tip' => true, - ), - - array( 'type' => 'sectionend', 'id' => 'account_page_options' ), - - array( 'title' => __( 'My Account Endpoints', 'sportspress' ), 'type' => 'title', 'desc' => __( 'Endpoints are appended to your page URLs to handle specific actions on the accounts pages. They should be unique.', 'sportspress' ), 'id' => 'account_endpoint_options' ), - - array( - 'title' => __( 'View Order', 'sportspress' ), - 'desc' => __( 'Endpoint for the My Account → View Order page', 'sportspress' ), - 'id' => 'sportspress_myaccount_view_order_endpoint', - 'type' => 'text', - 'default' => 'view-order', - 'desc_tip' => true, - ), - - array( - 'title' => __( 'Edit Account', 'sportspress' ), - 'desc' => __( 'Endpoint for the My Account → Edit Account page', 'sportspress' ), - 'id' => 'sportspress_myaccount_edit_account_endpoint', - 'type' => 'text', - 'default' => 'edit-account', - 'desc_tip' => true, - ), - - array( - 'title' => __( 'Edit Address', 'sportspress' ), - 'desc' => __( 'Endpoint for the My Account → Edit Address page', 'sportspress' ), - 'id' => 'sportspress_myaccount_edit_address_endpoint', - 'type' => 'text', - 'default' => 'edit-address', - 'desc_tip' => true, - ), - - array( - 'title' => __( 'Lost Password', 'sportspress' ), - 'desc' => __( 'Endpoint for the My Account → Lost Password page', 'sportspress' ), - 'id' => 'sportspress_myaccount_lost_password_endpoint', - 'type' => 'text', - 'default' => 'lost-password', - 'desc_tip' => true, - ), - - array( - 'title' => __( 'Logout', 'sportspress' ), - 'desc' => __( 'Endpoint for the triggering logout. You can add this to your menus via a custom link: yoursite.com/?customer-logout=true', 'sportspress' ), - 'id' => 'sportspress_logout_endpoint', - 'type' => 'text', - 'default' => 'customer-logout', - 'desc_tip' => true, - ), - - array( 'type' => 'sectionend', 'id' => 'account_endpoint_options' ), - - array( 'title' => __( 'Registration Options', 'sportspress' ), 'type' => 'title', 'id' => 'account_registration_options' ), - - array( - 'title' => __( 'Enable Registration', 'sportspress' ), - 'desc' => __( 'Enable registration on the "Checkout" page', 'sportspress' ), - 'id' => 'sportspress_enable_signup_and_login_from_checkout', - 'default' => 'yes', - 'type' => 'checkbox', - 'checkboxgroup' => 'start', - 'autoload' => false - ), - - array( - 'desc' => __( 'Enable registration on the "My Account" page', 'sportspress' ), - 'id' => 'sportspress_enable_myaccount_registration', - 'default' => 'no', - 'type' => 'checkbox', - 'checkboxgroup' => 'end', - 'autoload' => false - ), - - array( - 'desc' => __( 'Display returning customer login reminder on the "Checkout" page', 'sportspress' ), - 'id' => 'sportspress_enable_checkout_login_reminder', - 'default' => 'yes', - 'type' => 'checkbox', - 'checkboxgroup' => 'start', - 'autoload' => false - ), - - array( - 'title' => __( 'Account Creation', 'sportspress' ), - 'desc' => __( 'Automatically generate username from customer email', 'sportspress' ), - 'id' => 'sportspress_registration_generate_username', - 'default' => 'yes', - 'type' => 'checkbox', - 'checkboxgroup' => 'start', - 'autoload' => false - ), - - array( - 'desc' => __( 'Automatically generate customer password', 'sportspress' ), - 'id' => 'sportspress_registration_generate_password', - 'default' => 'no', - 'type' => 'checkbox', - 'checkboxgroup' => 'end', - 'autoload' => false - ), - - array( 'type' => 'sectionend', 'id' => 'account_registration_options'), - - )); // End pages settings - } -} - -endif; - -return new SP_Settings_Accounts(); \ No newline at end of file diff --git a/includes/admin/settings/class-sp-settings-checkout.php b/includes/admin/settings/class-sp-settings-checkout.php deleted file mode 100644 index f2d8c438..00000000 --- a/includes/admin/settings/class-sp-settings-checkout.php +++ /dev/null @@ -1,322 +0,0 @@ -id = 'checkout'; - $this->label = _x( 'Checkout', 'Settings tab label', 'sportspress' ); - - add_filter( 'sportspress_settings_tabs_array', array( $this, 'add_settings_page' ), 20 ); - add_action( 'sportspress_sections_' . $this->id, array( $this, 'output_sections' ) ); - add_action( 'sportspress_settings_' . $this->id, array( $this, 'output' ) ); - add_action( 'sportspress_admin_field_payment_gateways', array( $this, 'payment_gateways_setting' ) ); - add_action( 'sportspress_settings_save_' . $this->id, array( $this, 'save' ) ); - } - - /** - * Get sections - * - * @return array - */ - public function get_sections() { - $sections = array( - '' => __( 'Checkout Options', 'sportspress' ) - ); - - // Load shipping methods so we can show any global options they may have - $payment_gateways = SP()->payment_gateways->payment_gateways(); - - foreach ( $payment_gateways as $gateway ) { - - $title = empty( $gateway->method_title ) ? ucfirst( $gateway->id ) : $gateway->method_title; - - $sections[ strtolower( get_class( $gateway ) ) ] = esc_html( $title ); - } - - return $sections; - } - - /** - * Get settings array - * - * @return array - */ - public function get_settings() { - return apply_filters( 'sportspress_payment_gateways_settings', array( - - array( 'title' => __( 'Checkout Process', 'sportspress' ), 'type' => 'title', 'id' => 'checkout_process_options' ), - - array( - 'title' => __( 'Coupons', 'sportspress' ), - 'desc' => __( 'Enable the use of coupons', 'sportspress' ), - 'id' => 'sportspress_enable_coupons', - 'default' => 'yes', - 'type' => 'checkbox', - 'desc_tip' => __( 'Coupons can be applied from the cart and checkout pages.', 'sportspress' ), - 'autoload' => false - ), - - array( - 'title' => _x( 'Checkout', 'Settings group label', 'sportspress' ), - 'desc' => __( 'Enable guest checkout', 'sportspress' ), - 'desc_tip' => __( 'Allows customers to checkout without creating an account.', 'sportspress' ), - 'id' => 'sportspress_enable_guest_checkout', - 'default' => 'yes', - 'type' => 'checkbox', - 'checkboxgroup' => 'start', - 'autoload' => false - ), - - array( - 'desc' => __( 'Force secure checkout', 'sportspress' ), - 'id' => 'sportspress_force_ssl_checkout', - 'default' => 'no', - 'type' => 'checkbox', - 'checkboxgroup' => '', - 'show_if_checked' => 'option', - 'desc_tip' => __( 'Force SSL (HTTPS) on the checkout pages (an SSL Certificate is required).', 'sportspress' ), - ), - - array( - 'desc' => __( 'Un-force HTTPS when leaving the checkout', 'sportspress' ), - 'id' => 'sportspress_unforce_ssl_checkout', - 'default' => 'no', - 'type' => 'checkbox', - 'checkboxgroup' => 'end', - 'show_if_checked' => 'yes', - ), - - array( 'type' => 'sectionend', 'id' => 'checkout_process_options'), - - array( 'title' => __( 'Checkout Pages', 'sportspress' ), 'desc' => __( 'These pages need to be set so that SportsPress knows where to send users to checkout.', 'sportspress' ), 'type' => 'title', 'id' => 'checkout_page_options' ), - - array( - 'title' => __( 'Cart Page', 'sportspress' ), - 'desc' => __( 'Page contents:', 'sportspress' ) . ' [' . apply_filters( 'sportspress_cart_shortcode_tag', 'sportspress_cart' ) . ']', - 'id' => 'sportspress_cart_page_id', - 'type' => 'single_select_page', - 'default' => '', - 'class' => 'chosen_select_nostd', - 'css' => 'min-width:300px;', - 'desc_tip' => true, - ), - - array( - 'title' => __( 'Checkout Page', 'sportspress' ), - 'desc' => __( 'Page contents:', 'sportspress' ) . ' [' . apply_filters( 'sportspress_checkout_shortcode_tag', 'sportspress_checkout' ) . ']', - 'id' => 'sportspress_checkout_page_id', - 'type' => 'single_select_page', - 'default' => '', - 'class' => 'chosen_select_nostd', - 'css' => 'min-width:300px;', - 'desc_tip' => true, - ), - - array( - 'title' => __( 'Terms and Conditions', 'sportspress' ), - 'desc' => __( 'If you define a "Terms" page the customer will be asked if they accept them when checking out.', 'sportspress' ), - 'id' => 'sportspress_terms_page_id', - 'default' => '', - 'class' => 'chosen_select_nostd', - 'css' => 'min-width:300px;', - 'type' => 'single_select_page', - 'desc_tip' => true, - 'autoload' => false - ), - - array( 'type' => 'sectionend', 'id' => 'checkout_page_options' ), - - array( 'title' => __( 'Checkout Endpoints', 'sportspress' ), 'type' => 'title', 'desc' => __( 'Endpoints are appended to your page URLs to handle specific actions during the checkout process. They should be unique.', 'sportspress' ), 'id' => 'account_endpoint_options' ), - - array( - 'title' => __( 'Pay', 'sportspress' ), - 'desc' => __( 'Endpoint for the Checkout → Pay page', 'sportspress' ), - 'id' => 'sportspress_checkout_pay_endpoint', - 'type' => 'text', - 'default' => 'order-pay', - 'desc_tip' => true, - ), - - array( - 'title' => __( 'Order Received', 'sportspress' ), - 'desc' => __( 'Endpoint for the Checkout → Pay page', 'sportspress' ), - 'id' => 'sportspress_checkout_order_received_endpoint', - 'type' => 'text', - 'default' => 'order-received', - 'desc_tip' => true, - ), - - array( - 'title' => __( 'Add Payment Method', 'sportspress' ), - 'desc' => __( 'Endpoint for the Checkout → Add Payment Method page', 'sportspress' ), - 'id' => 'sportspress_myaccount_add_payment_method_endpoint', - 'type' => 'text', - 'default' => 'add-payment-method', - 'desc_tip' => true, - ), - - array( 'type' => 'sectionend', 'id' => 'checkout_endpoint_options' ), - - array( 'title' => __( 'Payment Gateways', 'sportspress' ), 'desc' => __( 'Installed gateways are listed below. Drag and drop gateways to control their display order on the frontend.', 'sportspress' ), 'type' => 'title', 'id' => 'payment_gateways_options' ), - - array( 'type' => 'payment_gateways' ), - - array( 'type' => 'sectionend', 'id' => 'payment_gateways_options' ), - - )); // End payment_gateway settings - } - - /** - * Output the settings - */ - public function output() { - global $current_section; - - // Load shipping methods so we can show any global options they may have - $payment_gateways = SP()->payment_gateways->payment_gateways(); - - if ( $current_section ) { - foreach ( $payment_gateways as $gateway ) { - if ( strtolower( get_class( $gateway ) ) == strtolower( $current_section ) ) { - $gateway->admin_options(); - break; - } - } - } else { - $settings = $this->get_settings(); - - SP_Admin_Settings::output_fields( $settings ); - } - } - - /** - * Output payment gateway settings. - * - * @access public - * @return void - */ - public function payment_gateways_setting() { - ?> -| ' . esc_html( $column ) . ' | '; - } - ?> -||||
|---|---|---|---|---|
| - id ), false ) . ' /> - - | '; - break; - case 'name' : - echo '- ' . $gateway->get_title() . ' - | '; - break; - case 'id' : - echo '- ' . esc_html( $gateway->id ) . ' - | '; - break; - case 'status' : - echo ''; - - if ( $gateway->enabled == 'yes' ) - echo '' . __ ( 'Enabled', 'sportspress' ) . ''; - else - echo '-'; - - echo ' | '; - break; - case 'settings' : - echo '- ' . __( 'Settings', 'sportspress' ) . ' - | '; - break; - default : - do_action( 'sportspress_payment_gateways_setting_column_' . $key, $gateway ); - break; - } - } - - echo '
| - | - | - | - |
|---|---|---|---|
| > | -- | ||
| post_name ); ?>> | -- | post_name; ?>for / post_name; ?>against | -- |
sportspress/templates/emails/ to yourtheme/sportspress/emails/.', 'sportspress' ), wp_nonce_url(admin_url('?preview_sportspress_mail=true'), 'preview-mail')), 'id' => 'email_template_options' ),
-
- array(
- 'title' => __( 'Header Image', 'sportspress' ),
- 'desc' => sprintf(__( 'Enter a URL to an image you want to show in the email\'s header. Upload your image using the media uploader.', 'sportspress' ), admin_url('media-new.php')),
- 'id' => 'sportspress_email_header_image',
- 'type' => 'text',
- 'css' => 'min-width:300px;',
- 'default' => '',
- 'autoload' => false
- ),
-
- array(
- 'title' => __( 'Email Footer Text', 'sportspress' ),
- 'desc' => __( 'The text to appear in the footer of SportsPress emails.', 'sportspress' ),
- 'id' => 'sportspress_email_footer_text',
- 'css' => 'width:100%; height: 75px;',
- 'type' => 'textarea',
- 'default' => get_bloginfo('title') . ' - ' . __( 'Powered by SportsPress', 'sportspress' ),
- 'autoload' => false
- ),
-
- array(
- 'title' => __( 'Base Colour', 'sportspress' ),
- 'desc' => __( 'The base colour for SportsPress email templates. Default #557da1.', 'sportspress' ),
- 'id' => 'sportspress_email_base_color',
- 'type' => 'color',
- 'css' => 'width:6em;',
- 'default' => '#557da1',
- 'autoload' => false
- ),
-
- array(
- 'title' => __( 'Background Colour', 'sportspress' ),
- 'desc' => __( 'The background colour for SportsPress email templates. Default #f5f5f5.', 'sportspress' ),
- 'id' => 'sportspress_email_background_color',
- 'type' => 'color',
- 'css' => 'width:6em;',
- 'default' => '#f5f5f5',
- 'autoload' => false
- ),
-
- array(
- 'title' => __( 'Email Body Background Colour', 'sportspress' ),
- 'desc' => __( 'The main body background colour. Default #fdfdfd.', 'sportspress' ),
- 'id' => 'sportspress_email_body_background_color',
- 'type' => 'color',
- 'css' => 'width:6em;',
- 'default' => '#fdfdfd',
- 'autoload' => false
- ),
-
- array(
- 'title' => __( 'Email Body Text Colour', 'sportspress' ),
- 'desc' => __( 'The main body text colour. Default #505050.', 'sportspress' ),
- 'id' => 'sportspress_email_text_color',
- 'type' => 'color',
- 'css' => 'width:6em;',
- 'default' => '#505050',
- 'autoload' => false
- ),
-
- array( 'type' => 'sectionend', 'id' => 'email_template_options' ),
-
- )); // End email settings
- }
-
- /**
- * Output the settings
- */
- public function output() {
- global $current_section;
-
- // Define emails that can be customised here
- $mailer = SP()->mailer();
- $email_templates = $mailer->get_emails();
-
- if ( $current_section ) {
- foreach ( $email_templates as $email ) {
- if ( strtolower( get_class( $email ) ) == $current_section ) {
- $email->admin_options();
- break;
- }
- }
- } else {
- $settings = $this->get_settings();
-
- SP_Admin_Settings::output_fields( $settings );
- }
- }
-
- /**
- * Save settings
- */
- public function save() {
- global $current_section;
-
- if ( ! $current_section ) {
-
- $settings = $this->get_settings();
- SP_Admin_Settings::save_fields( $settings );
-
- } else {
-
- // Load mailer
- $mailer = SP()->mailer();
-
- if ( class_exists( $current_section ) ) {
- $current_section_class = new $current_section();
- do_action( 'sportspress_update_options_' . $this->id . '_' . $current_section_class->id );
- SP()->mailer()->init();
- } else {
- do_action( 'sportspress_update_options_' . $this->id . '_' . $current_section );
- }
- }
- }
-}
-
-endif;
-
-return new SP_Settings_Emails();
\ No newline at end of file
diff --git a/includes/admin/settings/class-sp-settings-events.php b/includes/admin/settings/class-sp-settings-events.php
index 0076ae38..4bd1974b 100644
--- a/includes/admin/settings/class-sp-settings-events.php
+++ b/includes/admin/settings/class-sp-settings-events.php
@@ -18,7 +18,7 @@ if ( ! class_exists( 'SP_Settings_Events' ) ) :
class SP_Settings_Events extends SP_Settings_Page {
/**
- * Constructor.
+ * Constructor
*/
public function __construct() {
$this->id = 'events';
@@ -26,6 +26,7 @@ class SP_Settings_Events extends SP_Settings_Page {
add_filter( 'sportspress_settings_tabs_array', array( $this, 'add_settings_page' ), 20 );
add_action( 'sportspress_settings_' . $this->id, array( $this, 'output' ) );
+ add_action( 'sportspress_admin_field_delimiter', array( $this, 'delimiter_setting' ) );
add_action( 'sportspress_settings_save_' . $this->id, array( $this, 'save' ) );
}
@@ -35,674 +36,112 @@ class SP_Settings_Events extends SP_Settings_Page {
* @return array
*/
public function get_settings() {
- $tax_classes = array_filter( array_map( 'trim', explode( "\n", get_option( 'sportspress_tax_classes' ) ) ) );
- $classes_options = array();
- if ( $tax_classes )
- foreach ( $tax_classes as $class )
- $classes_options[ sanitize_title( $class ) ] = esc_html( $class );
- return apply_filters('sportspress_event_settings', array(
+ $settings = array(
- array( 'title' => __( 'Event Options', 'sportspress' ), 'type' => 'title','desc' => '', 'id' => 'tax_options' ),
+ array( 'title' => __( 'Event Options', 'sportspress' ), 'type' => 'title','desc' => '', 'id' => 'event_options' ),
array(
- 'title' => __( 'Delimiter', 'sportspress' ),
- 'id' => 'sportspress_event_teams_delimiter',
- 'default' => 'vs',
- 'type' => 'radio',
- 'options' => array(
- 'vs' => sprintf( '%s vs %s', __( 'Team', 'sportspress' ), __( 'Team', 'sportspress' ) ),
- 'v' => sprintf( '%s v %s', __( 'Team', 'sportspress' ), __( 'Team', 'sportspress' ) ),
- '—' => sprintf( '%s — %s', __( 'Team', 'sportspress' ), __( 'Team', 'sportspress' ) ),
- '/' => sprintf( '%s / %s', __( 'Team', 'sportspress' ), __( 'Team', 'sportspress' ) )
- ),
+ 'title' => __( 'Number of Teams', 'sportspress' ),
+ 'id' => 'sportspress_event_num_teams',
+ 'css' => 'width:50px;',
+ 'default' => '2',
+ 'type' => 'number',
+ 'custom_attributes' => array(
+ 'min' => 0,
+ 'step' => 1
+ )
+ ),
+
+ array( 'type' => 'delimiter' ),
+
+ array(
+ 'title' => __( 'Venue', 'sportspress' ),
+ 'desc' => __( 'Display maps', 'sportspress' ),
+ 'id' => 'sportspress_event_show_map',
+ 'default' => 'yes',
+ 'type' => 'checkbox',
+ 'checkboxgroup' => 'start',
),
array(
- 'title' => __( 'Calculate Tax Based On:', 'sportspress' ),
- 'id' => 'sportspress_tax_based_on',
- 'desc_tip' => __( 'This option determines which address is used to calculate tax.', 'sportspress' ),
- 'default' => 'shipping',
- 'type' => 'select',
- 'options' => array(
- 'shipping' => __( 'Customer shipping address', 'sportspress' ),
- 'billing' => __( 'Customer billing address', 'sportspress' ),
- 'base' => __( 'Shop base address', 'sportspress' )
- ),
- ),
-
- array(
- 'title' => __( 'Default Customer Address:', 'sportspress' ),
- 'id' => 'sportspress_default_customer_address',
- 'desc_tip' => __( 'This option determines the customers default address (before they input their own).', 'sportspress' ),
- 'default' => 'base',
- 'type' => 'select',
- 'options' => array(
- '' => __( 'No address', 'sportspress' ),
- 'base' => __( 'Shop base address', 'sportspress' ),
- ),
- ),
-
- array(
- 'title' => __( 'Shipping Tax Class:', 'sportspress' ),
- 'desc' => __( 'Optionally control which tax class shipping gets, or leave it so shipping tax is based on the cart items themselves.', 'sportspress' ),
- 'id' => 'sportspress_shipping_tax_class',
- 'css' => 'min-width:150px;',
- 'default' => 'title',
- 'type' => 'select',
- 'options' => array( '' => __( 'Shipping tax class based on cart items', 'sportspress' ), 'standard' => __( 'Standard', 'sportspress' ) ) + $classes_options,
- 'desc_tip' => true,
- ),
-
- array(
- 'title' => __( 'Rounding', 'sportspress' ),
- 'desc' => __( 'Round tax at subtotal level, instead of rounding per line', 'sportspress' ),
- 'id' => 'sportspress_tax_round_at_subtotal',
+ 'desc' => __( 'Link venues', 'sportspress' ),
+ 'id' => 'sportspress_event_link_venues',
'default' => 'no',
'type' => 'checkbox',
+ 'checkboxgroup' => 'end',
+ ),
+
+ array(
+ 'title' => __( 'Performance', 'sportspress' ),
+ 'desc' => __( 'Link players', 'sportspress' ),
+ 'id' => 'sportspress_event_link_players',
+ 'default' => 'yes',
+ 'type' => 'checkbox',
),
- array(
- 'title' => __( 'Additional Tax Classes', 'sportspress' ),
- 'desc' => __( 'List additonal tax classes below (1 per line). This is in addition to the default Standard Rate. Tax classes can be assigned to products.', 'sportspress' ),
- 'id' => 'sportspress_tax_classes',
- 'css' => 'width:100%; height: 65px;',
- 'type' => 'textarea',
- 'default' => sprintf( __( 'Reduced Rate%sZero Rate', 'sportspress' ), PHP_EOL )
- ),
-
- array(
- 'title' => __( 'Display prices in the shop:', 'sportspress' ),
- 'id' => 'sportspress_tax_display_shop',
- 'default' => 'excl',
- 'type' => 'select',
- 'options' => array(
- 'incl' => __( 'Including tax', 'sportspress' ),
- 'excl' => __( 'Excluding tax', 'sportspress' ),
- )
- ),
-
- array(
- 'title' => __( 'Price display suffix:', 'sportspress' ),
- 'id' => 'sportspress_price_display_suffix',
- 'default' => '',
- 'type' => 'text',
- 'desc' => __( 'Define text to show after your product prices. This could be, for example, "inc. Vat" to explain your pricing. You can also have prices substituted here using one of the following: {price_including_tax}, {price_excluding_tax}.', 'sportspress' ),
- ),
-
- array(
- 'title' => __( 'Display prices during cart/checkout:', 'sportspress' ),
- 'id' => 'sportspress_tax_display_cart',
- 'default' => 'excl',
- 'type' => 'select',
- 'options' => array(
- 'incl' => __( 'Including tax', 'sportspress' ),
- 'excl' => __( 'Excluding tax', 'sportspress' ),
- ),
- 'autoload' => false
- ),
-
- array(
- 'title' => __( 'Display tax totals:', 'sportspress' ),
- 'id' => 'sportspress_tax_total_display',
- 'default' => 'itemized',
- 'type' => 'select',
- 'options' => array(
- 'single' => __( 'As a single total', 'sportspress' ),
- 'itemized' => __( 'Itemized', 'sportspress' ),
- ),
- 'autoload' => false
- ),
-
- array( 'type' => 'results' ),
-
array( 'type' => 'sectionend', 'id' => 'event_options' ),
- )); // End event settings
- }
+ array( 'title' => __( 'Text', 'sportspress' ), 'type' => 'title', 'desc' => __( 'The following options affect how words are displayed on the frontend.', 'sportspress' ), 'id' => 'text_options' ),
- /**
- * Output the settings
- */
- public function output() {
- global $current_section;
+ );
- $tax_classes = array_filter( array_map( 'trim', explode( "\n", get_option('sportspress_tax_classes' ) ) ) );
+ foreach ( SP()->text->event as $key => $value ):
+ $settings[] = array(
+ 'title' => $value,
+ 'id' => 'sportspress_event_' . $key . '_text',
+ 'default' => '',
+ 'placeholder' => $value,
+ 'type' => 'text',
+ );
+ endforeach;
- if ( $current_section == 'standard' || in_array( $current_section, array_map( 'sanitize_title', $tax_classes ) ) ) {
- $this->output_tax_rates();
- } else {
- $settings = $this->get_settings();
+ $settings[] = array( 'type' => 'sectionend', 'id' => 'text_options' );
- SP_Admin_Settings::output_fields( $settings );
- }
+ return apply_filters( 'sportspress_event_settings', $settings ); // End event settings
}
/**
* Save settings
*/
public function save() {
- global $current_section, $wpdb;
-
- if ( ! $current_section ) {
-
- $settings = $this->get_settings();
- SP_Admin_Settings::save_fields( $settings );
-
- } else {
-
- $this->save_tax_rates();
-
- }
-
- $wpdb->query( "DELETE FROM `$wpdb->options` WHERE `option_name` LIKE ('_transient_sp_tax_rates_%') OR `option_name` LIKE ('_transient_timeout_sp_tax_rates_%')" );
+ $settings = $this->get_settings();
+ SP_Admin_Settings::save_fields( $settings );
+
+ if ( isset( $_POST['sportspress_event_teams_delimiter'] ) )
+ update_option( 'sportspress_event_teams_delimiter', $_POST['sportspress_event_teams_delimiter'] );
}
/**
- * Output tax rate tables
+ * Delimiter settings
+ *
+ * @access public
+ * @return void
*/
- public function output_tax_rates() {
- global $sportspress, $current_section, $wpdb;
+ public function delimiter_setting() {
+ $selection = get_option( 'sportspress_event_teams_delimiter', 'vs' );
- $page = ! empty( $_GET['p'] ) ? absint( $_GET['p'] ) : 1;
- $limit = 100;
- $tax_classes = array_filter( array_map( 'trim', explode( "\n", get_option('sportspress_tax_classes' ) ) ) );
- $current_class = '';
-
- foreach( $tax_classes as $class )
- if ( sanitize_title( $class ) == $current_section )
- $current_class = $class;
?>
-
- See here for available alpha-2 country codes.', 'sportspress' ), 'http://en.wikipedia.org/wiki/ISO_3166-1#Current_codes' ); ?>
-Standard Rate. Tax classes can be assigned to products.', 'sportspress' ),
- 'id' => 'sportspress_tax_classes',
- 'css' => 'width:100%; height: 65px;',
- 'type' => 'textarea',
- 'default' => sprintf( __( 'Reduced Rate%sZero Rate', 'sportspress' ), PHP_EOL )
+ 'title' => __( 'Player Lists', 'sportspress' ),
+ 'desc' => __( 'Link players', 'sportspress' ),
+ 'id' => 'sportspress_list_link_players',
+ 'default' => 'yes',
+ 'type' => 'checkbox',
),
- array(
- 'title' => __( 'Display prices in the shop:', 'sportspress' ),
- 'id' => 'sportspress_tax_display_shop',
- 'default' => 'excl',
- 'type' => 'select',
- 'options' => array(
- 'incl' => __( 'Including tax', 'sportspress' ),
- 'excl' => __( 'Excluding tax', 'sportspress' ),
- )
- ),
+ array( 'type' => 'sectionend', 'id' => 'player_options' ),
- array(
- 'title' => __( 'Price display suffix:', 'sportspress' ),
- 'id' => 'sportspress_price_display_suffix',
- 'default' => '',
- 'type' => 'text',
- 'desc' => __( 'Define text to show after your product prices. This could be, for example, "inc. Vat" to explain your pricing. You can also have prices substituted here using one of the following: {price_including_tax}, {price_excluding_tax}.', 'sportspress' ),
- ),
+ array( 'title' => __( 'Text', 'sportspress' ), 'type' => 'title', 'desc' => __( 'The following options affect how words are displayed on the frontend.', 'sportspress' ), 'id' => 'text_options' ),
- array(
- 'title' => __( 'Display prices during cart/checkout:', 'sportspress' ),
- 'id' => 'sportspress_tax_display_cart',
- 'default' => 'excl',
- 'type' => 'select',
- 'options' => array(
- 'incl' => __( 'Including tax', 'sportspress' ),
- 'excl' => __( 'Excluding tax', 'sportspress' ),
- ),
- 'autoload' => false
- ),
-
- array(
- 'title' => __( 'Display tax totals:', 'sportspress' ),
- 'id' => 'sportspress_tax_total_display',
- 'default' => 'itemized',
- 'type' => 'select',
- 'options' => array(
- 'single' => __( 'As a single total', 'sportspress' ),
- 'itemized' => __( 'Itemized', 'sportspress' ),
- ),
- 'autoload' => false
- ),
-
- array( 'type' => 'results' ),
-
- array( 'type' => 'sectionend', 'id' => 'event_options' ),
-
- )); // End event settings
- }
-
- /**
- * Output the settings
- */
- public function output() {
- global $current_section;
-
- $tax_classes = array_filter( array_map( 'trim', explode( "\n", get_option('sportspress_tax_classes' ) ) ) );
-
- if ( $current_section == 'standard' || in_array( $current_section, array_map( 'sanitize_title', $tax_classes ) ) ) {
- $this->output_tax_rates();
- } else {
- $settings = $this->get_settings();
-
- SP_Admin_Settings::output_fields( $settings );
- }
- }
-
- /**
- * Save settings
- */
- public function save() {
- global $current_section, $wpdb;
-
- if ( ! $current_section ) {
-
- $settings = $this->get_settings();
- SP_Admin_Settings::save_fields( $settings );
-
- } else {
-
- $this->save_tax_rates();
-
- }
-
- $wpdb->query( "DELETE FROM `$wpdb->options` WHERE `option_name` LIKE ('_transient_sp_tax_rates_%') OR `option_name` LIKE ('_transient_timeout_sp_tax_rates_%')" );
- }
-
- /**
- * Output tax rate tables
- */
- public function output_tax_rates() {
- global $sportspress, $current_section, $wpdb;
-
- $page = ! empty( $_GET['p'] ) ? absint( $_GET['p'] ) : 1;
- $limit = 100;
- $tax_classes = array_filter( array_map( 'trim', explode( "\n", get_option('sportspress_tax_classes' ) ) ) );
- $current_class = '';
-
- foreach( $tax_classes as $class )
- if ( sanitize_title( $class ) == $current_section )
- $current_class = $class;
- ?>
-
- See here for available alpha-2 country codes.', 'sportspress' ), 'http://en.wikipedia.org/wiki/ISO_3166-1#Current_codes' ); ?>
-| - | - | - | - |
|---|---|---|---|
| > | -- | ||
| post_name ); ?>> | -- | post_name; ?>for / post_name; ?>against | -- |
X-Accel-Redirect/ X-Sendfile can be used to serve downloads instead (server requires mod_xsendfile).', 'sportspress' ),
- 'id' => 'sportspress_file_download_method',
- 'type' => 'select',
- 'class' => 'chosen_select',
- 'css' => 'min-width:300px;',
- 'default' => 'force',
- 'desc_tip' => true,
- 'options' => array(
- 'force' => __( 'Force Downloads', 'sportspress' ),
- 'xsendfile' => __( 'X-Accel-Redirect/X-Sendfile', 'sportspress' ),
- 'redirect' => __( 'Redirect only', 'sportspress' ),
- ),
- 'autoload' => false
- ),
-
- array(
- 'title' => __( 'Access Restriction', 'sportspress' ),
- 'desc' => __( 'Downloads require login', 'sportspress' ),
- 'id' => 'sportspress_downloads_require_login',
- 'type' => 'checkbox',
- 'default' => 'no',
- 'desc_tip' => __( 'This setting does not apply to guest purchases.', 'sportspress' ),
- 'checkboxgroup' => 'start',
- 'autoload' => false
- ),
-
- array(
- 'desc' => __( 'Grant access to downloadable products after payment', 'sportspress' ),
- 'id' => 'sportspress_downloads_grant_access_after_payment',
- 'type' => 'checkbox',
- 'default' => 'yes',
- 'desc_tip' => __( 'Enable this option to grant access to downloads when orders are "processing", rather than "completed".', 'sportspress' ),
- 'checkboxgroup' => 'end',
- 'autoload' => false
- ),
-
- array( 'type' => 'sectionend', 'id' => 'digital_download_options' ),
-
- ));
- }
- }
-}
-
-endif;
-
-return new SP_Settings_Products();
\ No newline at end of file
diff --git a/includes/admin/settings/class-sp-settings-shipping.php b/includes/admin/settings/class-sp-settings-shipping.php
deleted file mode 100644
index e4ad3101..00000000
--- a/includes/admin/settings/class-sp-settings-shipping.php
+++ /dev/null
@@ -1,281 +0,0 @@
-id = 'shipping';
- $this->label = __( 'Shipping', 'sportspress' );
-
- add_filter( 'sportspress_settings_tabs_array', array( $this, 'add_settings_page' ), 20 );
- add_action( 'sportspress_sections_' . $this->id, array( $this, 'output_sections' ) );
- add_action( 'sportspress_settings_' . $this->id, array( $this, 'output' ) );
- add_action( 'sportspress_admin_field_shipping_methods', array( $this, 'shipping_methods_setting' ) );
- add_action( 'sportspress_settings_save_' . $this->id, array( $this, 'save' ) );
- }
-
- /**
- * Get sections
- *
- * @return array
- */
- public function get_sections() {
- $sections = array(
- '' => __( 'Shipping Options', 'sportspress' )
- );
-
- // Load shipping methods so we can show any global options they may have
- $shipping_methods = SP()->shipping->load_shipping_methods();
-
- foreach ( $shipping_methods as $method ) {
-
- if ( ! $method->has_settings() ) continue;
-
- $title = empty( $method->method_title ) ? ucfirst( $method->id ) : $method->method_title;
-
- $sections[ strtolower( get_class( $method ) ) ] = esc_html( $title );
- }
-
- return $sections;
- }
-
- /**
- * Get settings array
- *
- * @return array
- */
- public function get_settings() {
- return apply_filters('sportspress_shipping_settings', array(
-
- array( 'title' => __( 'Shipping Options', 'sportspress' ), 'type' => 'title', 'id' => 'shipping_options' ),
-
- array(
- 'title' => __( 'Shipping Calculations', 'sportspress' ),
- 'desc' => __( 'Enable shipping', 'sportspress' ),
- 'id' => 'sportspress_calc_shipping',
- 'default' => 'yes',
- 'type' => 'checkbox',
- 'checkboxgroup' => 'start'
- ),
-
- array(
- 'desc' => __( 'Enable the shipping calculator on the cart page', 'sportspress' ),
- 'id' => 'sportspress_enable_shipping_calc',
- 'default' => 'yes',
- 'type' => 'checkbox',
- 'checkboxgroup' => '',
- 'autoload' => false
- ),
-
- array(
- 'desc' => __( 'Hide shipping costs until an address is entered', 'sportspress' ),
- 'id' => 'sportspress_shipping_cost_requires_address',
- 'default' => 'no',
- 'type' => 'checkbox',
- 'checkboxgroup' => 'end',
- 'autoload' => false
- ),
-
- array(
- 'title' => __( 'Shipping Display Mode', 'sportspress' ),
- 'desc' => __( 'This controls how multiple shipping methods are displayed on the frontend.', 'sportspress' ),
- 'id' => 'sportspress_shipping_method_format',
- 'default' => '',
- 'type' => 'radio',
- 'options' => array(
- '' => __( 'Display shipping methods with "radio" buttons', 'sportspress' ),
- 'select' => __( 'Display shipping methods in a dropdown', 'sportspress' ),
- ),
- 'desc_tip' => true,
- 'autoload' => false
- ),
-
- array(
- 'title' => __( 'Shipping Destination', 'sportspress' ),
- 'desc' => __( 'Ship to billing address by default', 'sportspress' ),
- 'id' => 'sportspress_ship_to_billing',
- 'default' => 'yes',
- 'type' => 'checkbox',
- 'checkboxgroup' => 'start',
- 'autoload' => false,
- 'show_if_checked' => 'option',
- ),
-
- array(
- 'desc' => __( 'Only ship to the users billing address', 'sportspress' ),
- 'id' => 'sportspress_ship_to_billing_address_only',
- 'default' => 'no',
- 'type' => 'checkbox',
- 'checkboxgroup' => 'end',
- 'autoload' => false,
- 'show_if_checked' => 'yes',
- ),
-
- array(
- 'title' => __( 'Restrict shipping to Location(s)', 'sportspress' ),
- 'desc' => sprintf( __( 'Choose which countries you want to ship to, or choose to ship to all locations you sell to.', 'sportspress' ), admin_url( 'admin.php?page=sp-settings&tab=general' ) ),
- 'id' => 'sportspress_ship_to_countries',
- 'default' => '',
- 'type' => 'select',
- 'class' => 'chosen_select',
- 'desc_tip' => false,
- 'options' => array(
- '' => __( 'Ship to all countries you sell to', 'sportspress' ),
- 'all' => __( 'Ship to all countries', 'sportspress' ),
- 'specific' => __( 'Ship to specific countries only', 'sportspress' )
- )
- ),
-
- array(
- 'title' => __( 'Specific Countries', 'sportspress' ),
- 'desc' => '',
- 'id' => 'sportspress_specific_ship_to_countries',
- 'css' => '',
- 'default' => '',
- 'type' => 'multi_select_countries'
- ),
-
- array(
- 'type' => 'shipping_methods',
- ),
-
- array( 'type' => 'sectionend', 'id' => 'shipping_options' ),
-
- )); // End shipping settings
- }
-
- /**
- * Output the settings
- */
- public function output() {
- global $current_section;
-
- // Load shipping methods so we can show any global options they may have
- $shipping_methods = SP()->shipping->load_shipping_methods();
-
- if ( $current_section ) {
- foreach ( $shipping_methods as $method ) {
- if ( strtolower( get_class( $method ) ) == strtolower( $current_section ) && $method->has_settings() ) {
- $method->admin_options();
- break;
- }
- }
- } else {
- $settings = $this->get_settings();
-
- SP_Admin_Settings::output_fields( $settings );
- }
- }
-
- /**
- * Output shipping method settings.
- *
- * @access public
- * @return void
- */
- public function shipping_methods_setting() {
- $default_shipping_method = esc_attr( get_option('sportspress_default_shipping_method') );
- ?>
- | - | - | - | - | - |
|---|---|---|---|---|
| - /> - | -- | - | ||
| - id, false ) . ' /> - - | -- ' . $method->get_title() . ' - | -- ' . $method->id . ' - | -'; - - if ( $method->enabled == 'yes' ) - echo '' . __ ( 'Enabled', 'sportspress' ) . ''; - else - echo '-'; - - echo ' | -'; - - if ( $method->has_settings ) { - echo '' . __( 'Settings', 'sportspress' ) . ''; - } - - echo ' | -
Standard Rate. Tax classes can be assigned to products.', 'sportspress' ),
- 'id' => 'sportspress_tax_classes',
- 'css' => 'width:100%; height: 65px;',
- 'type' => 'textarea',
- 'default' => sprintf( __( 'Reduced Rate%sZero Rate', 'sportspress' ), PHP_EOL )
- ),
-
- array(
- 'title' => __( 'Display prices in the shop:', 'sportspress' ),
- 'id' => 'sportspress_tax_display_shop',
- 'default' => 'excl',
- 'type' => 'select',
- 'options' => array(
- 'incl' => __( 'Including tax', 'sportspress' ),
- 'excl' => __( 'Excluding tax', 'sportspress' ),
- )
- ),
-
- array(
- 'title' => __( 'Price display suffix:', 'sportspress' ),
- 'id' => 'sportspress_price_display_suffix',
- 'default' => '',
- 'type' => 'text',
- 'desc' => __( 'Define text to show after your product prices. This could be, for example, "inc. Vat" to explain your pricing. You can also have prices substituted here using one of the following: {price_including_tax}, {price_excluding_tax}.', 'sportspress' ),
- ),
-
- array(
- 'title' => __( 'Display prices during cart/checkout:', 'sportspress' ),
- 'id' => 'sportspress_tax_display_cart',
- 'default' => 'excl',
- 'type' => 'select',
- 'options' => array(
- 'incl' => __( 'Including tax', 'sportspress' ),
- 'excl' => __( 'Excluding tax', 'sportspress' ),
- ),
- 'autoload' => false
- ),
-
- array(
- 'title' => __( 'Display tax totals:', 'sportspress' ),
- 'id' => 'sportspress_tax_total_display',
- 'default' => 'itemized',
- 'type' => 'select',
- 'options' => array(
- 'single' => __( 'As a single total', 'sportspress' ),
- 'itemized' => __( 'Itemized', 'sportspress' ),
- ),
- 'autoload' => false
- ),
-
- array( 'type' => 'sectionend', 'id' => 'tax_options' ),
-
- )); // End tax settings
- }
-
- /**
- * Output the settings
- */
- public function output() {
- global $current_section;
-
- $tax_classes = array_filter( array_map( 'trim', explode( "\n", get_option('sportspress_tax_classes' ) ) ) );
-
- if ( $current_section == 'standard' || in_array( $current_section, array_map( 'sanitize_title', $tax_classes ) ) ) {
- $this->output_tax_rates();
- } else {
- $settings = $this->get_settings();
-
- SP_Admin_Settings::output_fields( $settings );
- }
- }
-
- /**
- * Save settings
- */
- public function save() {
- global $current_section, $wpdb;
-
- if ( ! $current_section ) {
-
- $settings = $this->get_settings();
- SP_Admin_Settings::save_fields( $settings );
-
- } else {
-
- $this->save_tax_rates();
-
- }
-
- $wpdb->query( "DELETE FROM `$wpdb->options` WHERE `option_name` LIKE ('_transient_sp_tax_rates_%') OR `option_name` LIKE ('_transient_timeout_sp_tax_rates_%')" );
- }
-
- /**
- * Output tax rate tables
- */
- public function output_tax_rates() {
- global $sportspress, $current_section, $wpdb;
-
- $page = ! empty( $_GET['p'] ) ? absint( $_GET['p'] ) : 1;
- $limit = 100;
- $tax_classes = array_filter( array_map( 'trim', explode( "\n", get_option('sportspress_tax_classes' ) ) ) );
- $current_class = '';
-
- foreach( $tax_classes as $class )
- if ( sanitize_title( $class ) == $current_section )
- $current_class = $class;
- ?>
-
- See here for available alpha-2 country codes.', 'sportspress' ), 'http://en.wikipedia.org/wiki/ISO_3166-1#Current_codes' ); ?>
-Standard Rate. Tax classes can be assigned to products.', 'sportspress' ),
- 'id' => 'sportspress_tax_classes',
- 'css' => 'width:100%; height: 65px;',
- 'type' => 'textarea',
- 'default' => sprintf( __( 'Reduced Rate%sZero Rate', 'sportspress' ), PHP_EOL )
- ),
+ array( 'type' => 'sectionend', 'id' => 'team_options' ),
- array(
- 'title' => __( 'Display prices in the shop:', 'sportspress' ),
- 'id' => 'sportspress_tax_display_shop',
- 'default' => 'excl',
- 'type' => 'select',
- 'options' => array(
- 'incl' => __( 'Including tax', 'sportspress' ),
- 'excl' => __( 'Excluding tax', 'sportspress' ),
- )
- ),
+ array( 'title' => __( 'Text', 'sportspress' ), 'type' => 'title', 'desc' => __( 'The following options affect how words are displayed on the frontend.', 'sportspress' ), 'id' => 'text_options' ),
- array(
- 'title' => __( 'Price display suffix:', 'sportspress' ),
- 'id' => 'sportspress_price_display_suffix',
- 'default' => '',
- 'type' => 'text',
- 'desc' => __( 'Define text to show after your product prices. This could be, for example, "inc. Vat" to explain your pricing. You can also have prices substituted here using one of the following: {price_including_tax}, {price_excluding_tax}.', 'sportspress' ),
- ),
-
- array(
- 'title' => __( 'Display prices during cart/checkout:', 'sportspress' ),
- 'id' => 'sportspress_tax_display_cart',
- 'default' => 'excl',
- 'type' => 'select',
- 'options' => array(
- 'incl' => __( 'Including tax', 'sportspress' ),
- 'excl' => __( 'Excluding tax', 'sportspress' ),
- ),
- 'autoload' => false
- ),
-
- array(
- 'title' => __( 'Display tax totals:', 'sportspress' ),
- 'id' => 'sportspress_tax_total_display',
- 'default' => 'itemized',
- 'type' => 'select',
- 'options' => array(
- 'single' => __( 'As a single total', 'sportspress' ),
- 'itemized' => __( 'Itemized', 'sportspress' ),
- ),
- 'autoload' => false
- ),
-
- array( 'type' => 'results' ),
-
- array( 'type' => 'sectionend', 'id' => 'event_options' ),
-
- )); // End event settings
- }
-
- /**
- * Output the settings
- */
- public function output() {
- global $current_section;
-
- $tax_classes = array_filter( array_map( 'trim', explode( "\n", get_option('sportspress_tax_classes' ) ) ) );
-
- if ( $current_section == 'standard' || in_array( $current_section, array_map( 'sanitize_title', $tax_classes ) ) ) {
- $this->output_tax_rates();
- } else {
- $settings = $this->get_settings();
-
- SP_Admin_Settings::output_fields( $settings );
- }
- }
-
- /**
- * Save settings
- */
- public function save() {
- global $current_section, $wpdb;
-
- if ( ! $current_section ) {
-
- $settings = $this->get_settings();
- SP_Admin_Settings::save_fields( $settings );
-
- } else {
-
- $this->save_tax_rates();
-
- }
-
- $wpdb->query( "DELETE FROM `$wpdb->options` WHERE `option_name` LIKE ('_transient_sp_tax_rates_%') OR `option_name` LIKE ('_transient_timeout_sp_tax_rates_%')" );
- }
-
- /**
- * Output tax rate tables
- */
- public function output_tax_rates() {
- global $sportspress, $current_section, $wpdb;
-
- $page = ! empty( $_GET['p'] ) ? absint( $_GET['p'] ) : 1;
- $limit = 100;
- $tax_classes = array_filter( array_map( 'trim', explode( "\n", get_option('sportspress_tax_classes' ) ) ) );
- $current_class = '';
-
- foreach( $tax_classes as $class )
- if ( sanitize_title( $class ) == $current_section )
- $current_class = $class;
- ?>
-
- See here for available alpha-2 country codes.', 'sportspress' ), 'http://en.wikipedia.org/wiki/ISO_3166-1#Current_codes' ); ?>
-| - | - | - | - |
|---|---|---|---|
| > | -- | ||
| post_name ); ?>> | -- | post_name; ?>for / post_name; ?>against | -- |
' . wp_kses_post( preg_replace( '~\[([^\]]*)\]\(([^\)]*)\)~', '${1}', $line ) ) . '
'; + } + + echo '' . esc_html( htmlspecialchars( $line ) ) . '
'; + } + } + + if ( $ul ) { + echo ''; + } + + echo '| ' . __( 'Date', 'sportspress' ). ' | '; +$output .= '' . SP()->text->string('Date', 'event') . ' | '; if ( $usecolumns == null || in_array( 'event', $usecolumns ) ) - $output .= '' . __( 'Event', 'sportspress' ). ' | '; + $output .= '' . SP()->text->string('Event', 'event') . ' | '; if ( $usecolumns == null || in_array( 'teams', $usecolumns ) ) - $output .= '' . __( 'Teams', 'sportspress' ). ' | '; + $output .= '' . SP()->text->string('Teams', 'event') . ' | '; if ( $usecolumns == null || in_array( 'time', $usecolumns ) ) - $output .= '' . __( 'Time', 'sportspress' ). ' | '; + $output .= '' . SP()->text->string('Time', 'event') . ' | '; if ( $usecolumns == null || in_array( 'article', $usecolumns ) ) - $output .= '' . __( 'Article', 'sportspress' ). ' | '; + $output .= '' . SP()->text->string('Article', 'event') . ' | '; $output .= '' . '' . ''; @@ -40,13 +40,13 @@ foreach ( $data as $event ): $output .= '
|---|---|---|---|---|---|---|---|---|---|
| ' . get_post_time( get_option( 'date_format' ), false, $event ) . ' | '; + $output .= '' . get_post_time( get_option( 'date_format' ), false, $event ) . ' | '; if ( $usecolumns == null || in_array( 'event', $usecolumns ) ) - $output .= '' . $event->post_title . ' | '; + $output .= '' . $event->post_title . ' | '; if ( $usecolumns == null || in_array( 'teams', $usecolumns ) ): - $output .= ''; + $output .= ' | '; $teams = get_post_meta( $event->ID, 'sp_team', false ); if ( $teams ): @@ -83,11 +83,11 @@ foreach ( $data as $event ): endif; if ( $usecolumns == null || in_array( 'time', $usecolumns ) ) - $output .= ' | ' . get_post_time( get_option( 'time_format' ), false, $event ) . ' | '; + $output .= '' . get_post_time( get_option( 'time_format' ), false, $event ) . ' | '; if ( $usecolumns == null || in_array( 'article', $usecolumns ) ): - $output .= '- '; + $output .= ' | + '; if ( $video ): $output .= ''; @@ -96,9 +96,9 @@ foreach ( $data as $event ): endif; if ( $event->post_content !== null ): if ( $event->post_status == 'publish' ): - $output .= __( 'Recap', 'sportspress' ); + $output .= SP()->text->string('Recap', 'event'); else: - $output .= __( 'Preview', 'sportspress' ); + $output .= SP()->text->string('Preview', 'event'); endif; endif; @@ -114,7 +114,7 @@ endforeach; $output .= ' |
| # | '; - $output .= '' . __( 'Player', 'sportspress' ) . ' | '; + $output .= '' . SP()->text->string('Player', 'event') . ' | '; foreach( $performance_labels as $key => $label ): $output .= '' . $label . ' | '; @@ -94,7 +94,7 @@ foreach( $teams as $key => $team_id ): // Player number $output .= ''; - $output .= ' | ' . __( 'Total', 'sportspress' ) . ' | '; + $output .= '' . SP()->text->string('Total', 'event') . ' | '; $row = $data[0]; diff --git a/templates/event-results.php b/templates/event-results.php index 713b67c1..108d65c0 100644 --- a/templates/event-results.php +++ b/templates/event-results.php @@ -49,11 +49,11 @@ if ( empty( $table_rows ) ): else: - $output .= '
|---|
| ' . __( 'Team', 'sportspress' ) . ' | '; + '' . SP()->text->string('Team', 'event') . ' | '; foreach( $result_labels as $key => $label ): $output .= '' . $label . ' | '; endforeach; diff --git a/templates/event-venue.php b/templates/event-venue.php index e7687c80..71f9127b 100644 --- a/templates/event-venue.php +++ b/templates/event-venue.php @@ -18,7 +18,7 @@ foreach( $venues as $venue ): $latitude = sportspress_array_value( $term_meta, 'sp_latitude', 0 ); $longitude = sportspress_array_value( $term_meta, 'sp_longitude', 0 ); - $output .= '' . __( 'Pos', 'sportspress' ) . ' | '; +$output .= '' . SP()->text->string('Pos', 'team') . ' | '; foreach( $labels as $key => $label ): if ( ! is_array( $columns ) || $key == 'name' || in_array( $key, $columns ) ) @@ -83,7 +83,7 @@ endforeach; $output .= '' . '
|---|
| ' . $label . ' | '; diff --git a/templates/player-list.php b/templates/player-list.php index f6061e5e..bcc09504 100644 --- a/templates/player-list.php +++ b/templates/player-list.php @@ -8,9 +8,9 @@ $defaults = array( 'orderby' => 'default', 'order' => 'ASC', 'show_all_players_link' => false, - 'link_posts' => sportspress_array_value( $sportspress_options, 'player_list_link_posts', true ), - 'sortable' => sportspress_array_value( $sportspress_options, 'player_list_sortable', true ), - 'responsive' => sportspress_array_value( $sportspress_options, 'player_list_responsive', true ), + 'link_posts' => get_option( 'sportspress_list_link_players', 'yes' ) == 'yes' ? true : false, + 'sortable' => get_option( 'sportspress_enable_sortable_tables', 'yes' ) == 'yes' ? true : false, + 'responsive' => get_option( 'sportspress_enable_responsive_tables', 'yes' ) == 'yes' ? true : false, ); extract( $defaults, EXTR_SKIP ); @@ -43,7 +43,7 @@ endif; if ( in_array( $orderby, array( 'number', 'name' ) ) ): $output .= '# | '; else: - $output .= '' . __( 'Rank', 'sportspress' ) . ' | '; + $output .= '' . SP()->text->string('Rank', 'player') . ' | '; endif; foreach( $labels as $key => $label ): @@ -97,6 +97,6 @@ endforeach; $output .= '' . '
|---|
' : '' ) . $country_name : '—';
+ $common[ SP()->text->string('Nationality', 'player') ] = $country_name ? ( $show_nationality_flag ? '
' : '' ) . $country_name : '—';
endif;
$data = array_merge( $common, $metrics );
if ( $current_team )
- $data[ __( 'Current Team', 'sportspress' ) ] = '' . get_the_title( $current_team ) . '';
+ $data[ SP()->text->string('Current Team', 'player') ] = '' . get_the_title( $current_team ) . '';
if ( $past_teams ):
$teams = array();
foreach ( $past_teams as $team ):
$teams[] = '' . get_the_title( $team ) . '';
endforeach;
- $data[ __( 'Past Teams', 'sportspress' ) ] = implode( ', ', $teams );
+ $data[ SP()->text->string('Past Teams', 'player') ] = implode( ', ', $teams );
endif;
$output = '