';
50 | break;
51 | }
52 |
--------------------------------------------------------------------------------
/includes/admin/post-types/meta-boxes/class-wpcm-meta-box-club-players.php:
--------------------------------------------------------------------------------
1 | 'wpcm_player',
31 | 'posts_per_page' => -1,
32 | 'meta_query' => array(
33 | array(
34 | 'key' => '_wpcm_player_club',
35 | 'value' => $post->ID,
36 | ),
37 | ),
38 | );
39 |
40 | $players = get_posts( $args );
41 | ?>
42 |
43 |
44 |
45 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
57 |
58 |
59 |
62 |
63 |
64 |
65 |
66 | post_title ); ?>
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 | ' );
24 |
25 | // empty array
26 | var updated_array = [];
27 |
28 | // store the updated tax ID
29 | jQuery( '#the-list' ).find( 'tr' ).each( function() {
30 | var tax_id = jQuery( this ).attr( 'id' ).replace( 'tag-', '' );
31 | updated_array.push( [ tax_id, jQuery( this ).index() ] );
32 | });
33 |
34 | // build the ajax data
35 | var data = {
36 | 'action': 'update_taxonomy_order',
37 | 'updated_array': updated_array
38 | };
39 | // Run the ajax request
40 | jQuery.post( localized_data.ajax_url, data, function( response ) {
41 | jQuery( '.wpcm-simple-taxonomy-preloader' ).remove();
42 | jQuery( ui.item[0] ).find( 'input[type="checkbox"]' ).show();
43 | });
44 | },
45 | });
46 |
47 | jQuery( "#the-list" ).disableSelection();
48 |
49 | }
50 |
51 | });
--------------------------------------------------------------------------------
/templates/content-widget-results.php:
--------------------------------------------------------------------------------
1 | post_date ); ?>
16 |
17 |
18 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
55 |
56 |
--------------------------------------------------------------------------------
/templates/content-widget-fixtures.php:
--------------------------------------------------------------------------------
1 | post_date ); ?>
16 |
17 |
18 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
51 |
52 |
53 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/templates/content-single-player.php:
--------------------------------------------------------------------------------
1 |
16 |
17 |
18 |
19 | >
20 |
21 |
22 |
23 |
31 |
32 |
33 |
34 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
58 |
59 |
60 |
61 |
62 |
63 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
--------------------------------------------------------------------------------
/includes/admin/post-types/meta-boxes/class-wpcm-meta-box-club-table.php:
--------------------------------------------------------------------------------
1 |
30 |
31 |
32 | 'add_to_table',
35 | 'id' => 'add_to_table',
36 | 'post_type' => 'wpcm_table',
37 | 'limit' => -1,
38 | 'show_option_none' => __( 'None', 'wp-club-manager' ),
39 | 'class' => 'chosen_select',
40 | 'order' => 'DESC',
41 | 'orderby' => 'date',
42 | 'echo' => false,
43 | ));
44 | ?>
45 |
46 |
47 |
13 |
14 |
15 |
16 | ' . esc_html( $title ) . '' : '' ); ?>
17 |
18 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
--------------------------------------------------------------------------------
/assets/js/admin/editor-lang.php:
--------------------------------------------------------------------------------
1 | array(
7 | 'player_list', 'player_gallery'
8 | ),
9 | 'staff' => array(
10 | 'staff_list', 'staff_gallery'
11 | ),
12 | 'match' => array(
13 | 'match_opponents', 'match_list'
14 | ),
15 | 'league' => array(
16 | 'league_table'
17 | ),
18 | 'maps' => array(
19 | 'map_venue'
20 | ),
21 | );
22 |
23 | $options = apply_filters( 'wpclubmanager_shortcodes', $options );
24 |
25 | foreach ( $options as $name => $group ) {
26 | if ( empty( $group ) ) continue;
27 | $shortcodes .= $name . '[' . implode( '|', $group ) . ']';
28 | }
29 |
30 | $raw = apply_filters( 'wpclubmanager_tinymce_strings', array(
31 | 'shortcodes' => $shortcodes,
32 | 'insert' => __( 'WP Club Manager Shortcodes', 'wp-club-manager' ),
33 | 'match' => __( 'Matches', 'wp-club-manager' ),
34 | 'player' => __( 'Players', 'wp-club-manager' ),
35 | 'staff' => __( 'Staff', 'wp-club-manager' ),
36 | 'league' => __( 'Standings', 'wp-club-manager' ),
37 | 'maps' => __( 'Maps', 'wp-club-manager' ),
38 | 'match_opponents' => __( 'Match Opponents', 'wp-club-manager' ),
39 | 'match_list' => __( 'Match List', 'wp-club-manager' ),
40 | 'player_list' => __( 'Player List', 'wp-club-manager' ),
41 | 'player_gallery' => __( 'Player Gallery', 'wp-club-manager' ),
42 | 'staff_list' => __( 'Staff List', 'wp-club-manager' ),
43 | 'staff_gallery' => __( 'Staff Gallery', 'wp-club-manager' ),
44 | 'league_table' => __( 'League Table', 'wp-club-manager' ),
45 | 'map_venue' => __( 'Venue Map', 'wp-club-manager' ),
46 | ));
47 |
48 | $formatted = array();
49 |
50 | foreach ( $raw as $key => $value ) {
51 | $formatted[] = $key . ': "' . esc_js( $value ) . '"';
52 | }
53 |
54 | $strings = 'tinyMCE.addI18n({' . _WP_Editors::$mce_locale . ':{
55 | wpclubmanager:{
56 | ' . implode( ', ', $formatted ) . '
57 | }
58 | }})';
59 |
--------------------------------------------------------------------------------
/includes/admin/views/html-quick-edit-staff.php:
--------------------------------------------------------------------------------
1 |
11 |
12 |
13 |
14 |
15 |
16 |
60 |
61 |
--------------------------------------------------------------------------------
/includes/admin/views/html-quick-edit-player.php:
--------------------------------------------------------------------------------
1 |
11 |
12 |
13 |
14 |
15 |
16 |
60 |
61 |
--------------------------------------------------------------------------------
/includes/class-wpcm-reset-database.php:
--------------------------------------------------------------------------------
1 | query( "DELETE FROM $wpdb->options WHERE option_name LIKE 'wpcm_%';" );
28 | $wpdb->query( "DELETE FROM $wpdb->options WHERE option_name LIKE 'wpclubmanager_%';" );
29 | $wpdb->query( "DELETE FROM $wpdb->options WHERE option_name LIKE '_wpcm_%';" );
30 |
31 | $this->delete_terms( 'wpcm_comp' );
32 | $this->delete_terms( 'wpcm_jobs' );
33 | $this->delete_terms( 'wpcm_position' );
34 | $this->delete_terms( 'wpcm_season' );
35 | $this->delete_terms( 'wpcm_team' );
36 | $this->delete_terms( 'wpcm_venue' );
37 |
38 | $wpdb->query( "DELETE meta FROM {$wpdb->postmeta} meta INNER JOIN {$wpdb->posts} posts ON posts.ID = meta.post_id WHERE posts.post_type IN ( 'wpcm_player', 'wpcm_staff', 'wpcm_club', 'wpcm_match', 'wpcm_sponsor', 'wpcm_roster', 'wpcm_table' );" );
39 | $wpdb->query( "DELETE FROM {$wpdb->posts} WHERE post_type IN ( 'wpcm_player', 'wpcm_staff', 'wpcm_club', 'wpcm_match', 'wpcm_sponsor', 'wpcm_roster', 'wpcm_table' );" );
40 |
41 | delete_option( 'wpclubmanager_installed' );
42 | }
43 |
44 | /**
45 | * @param string $taxonomy
46 | *
47 | * @return void
48 | */
49 | protected function delete_terms( $taxonomy ) {
50 | $terms = get_terms( array(
51 | 'taxonomy' => $taxonomy,
52 | 'hide_empty' => false,
53 | ) );
54 |
55 | if ( empty( $terms ) || is_wp_error( $terms ) ) {
56 | return;
57 | }
58 |
59 | foreach ( $terms as $term ) {
60 | if ( $term && $term->term_id ) {
61 | wp_delete_term( $term->term_id, $taxonomy );
62 | }
63 | }
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/templates/content-widget-birthdays.php:
--------------------------------------------------------------------------------
1 |
13 |
14 |
69 |
--------------------------------------------------------------------------------
/includes/wpcm-deprecated-functions.php:
--------------------------------------------------------------------------------
1 | $key,
58 | 'value' => $value,
59 | 'count' => $count,
60 | ) );
61 | }
62 |
63 | /**
64 | * @param array $stats
65 | * @param int $team
66 | * @param int $season
67 | *
68 | * @return null
69 | */
70 | function wpcm_profile_stats_table( $stats = array(), $team = 0, $season = 0 ) {
71 | _deprecated_function( 'wpcm_profile_stats_table', '1.4.0', '' );
72 | return wpclubmanager_get_template( 'single-player/stats-table.php', array(
73 | 'stats' => $stats,
74 | 'team' => $team,
75 | 'season' => $season,
76 | ) );
77 | }
78 |
79 | /**
80 | * @param WP_Post|int|null $post
81 | *
82 | * @return array
83 | */
84 | function get_wpcm_player_stats_from_post( $post = null ) {
85 | _deprecated_function( 'get_wpcm_player_stats_from_post', '1.4.0', '' );
86 | return get_wpcm_player_stats( $post );
87 | }
88 |
--------------------------------------------------------------------------------
/includes/admin/post-types/meta-boxes/class-wpcm-meta-box-player-display.php:
--------------------------------------------------------------------------------
1 | ID, '_wpcm_custom_player_stats', true )?>
33 |
34 |
35 | $val ) :
37 | if ( 'yes' === get_option( 'wpcm_show_stats_' . $key ) ) :
38 | ?>
39 |
40 |
41 | />
42 |
43 |
44 |
45 |
49 |
50 |
51 | $value ) {
68 | $player_stats[ sanitize_text_field( $key ) ] = '';
69 | }
70 | update_post_meta( $post_id, '_wpcm_custom_player_stats', $player_stats );
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/assets/js/admin/wpclubmanager_admin.min.js:
--------------------------------------------------------------------------------
1 | jQuery(function(a){if(jQuery("body").click(function(){jQuery(".wpcm_error_tip").fadeOut("100",function(){jQuery(this).remove()})}),jQuery("select.chosen_select").chosen({width:"220px",disable_search_threshold:18}),jQuery("select.wpcm-chosen-multiple").chosen({width:"90%"}),jQuery("#input-order").length){jQuery("select.wpcm-chosen-multiple").on("change",function(a){var b=jQuery(this).get(0);setTimeout(function(){var a=ChosenOrder.getSelectionOrder(b);jQuery("#input-order").val(a).toString().split(",")})});var b=jQuery("select.wpcm-chosen-multiple").get(0);ChosenOrder.setSelectionOrder(b,jQuery("#input-order").val().split(","),!0)}jQuery(".wpcm_stats-tabs a").click(function(){var a=jQuery(this).attr("href");return jQuery(this).parent().addClass("tabs").siblings("li").removeClass("tabs"),jQuery(this).parent().parent().parent().find(".tabs-panel").hide(),jQuery(a).show(),!1}),jQuery(".wpcm-address").keypress(function(a){return 13!=a.keyCode});var c=jQuery('input[type="radio"][name="wpcm_map_select"]:checked').val(),d=jQuery('input[type="radio"][name="wpcm_osm_layer"]:checked').val();"osm"==c&&(jQuery("#wpcm_osm_layer-row").show(),jQuery("#wpcm_google_map_api-row").hide(),jQuery("#wpcm_map_type-row").hide(),"mapbox"==d&&(jQuery("#wpcm_mapbox_api-row").show(),jQuery("#wpcm_mapbox_type-row").show())),"google"==c&&jQuery("#wpcm_google_map_api-row").show(),jQuery('input[type="radio"][name="wpcm_map_select"]').on("change",function(){switch(jQuery(this).val()){case"osm":jQuery("#wpcm_osm_layer-row").show(),jQuery("#wpcm_google_map_api-row").hide(),jQuery("#wpcm_map_type-row").hide(),"mapbox"==d&&(jQuery("#wpcm_mapbox_api-row").show(),jQuery("#wpcm_mapbox_type-row").show());break;case"google":jQuery("#wpcm_osm_layer-row").hide(),jQuery("#wpcm_mapbox_api-row").hide(),jQuery("#wpcm_mapbox_type-row").hide(),jQuery("#wpcm_google_map_api-row").show(),jQuery("#wpcm_map_type-row").show()}}),jQuery('input[type="radio"][name="wpcm_osm_layer"]').on("change",function(){switch(jQuery(this).val()){case"mapbox":jQuery("#wpcm_mapbox_api-row").show(),jQuery("#wpcm_mapbox_type-row").show();break;case"standard":jQuery("#wpcm_mapbox_api-row").hide(),jQuery("#wpcm_mapbox_type-row").hide()}})});
--------------------------------------------------------------------------------
/includes/admin/post-types/meta-boxes/class-wpcm-meta-box-match-video.php:
--------------------------------------------------------------------------------
1 | ID, '_wpcm_video', true );
30 |
31 | if ( $video ) : ?>
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
47 |
48 |
49 | ID, 'wpcm_link_nw', true );
32 |
33 | do_action( 'wpclubmanager_before_admin_sponsors_meta', $post->ID );
34 |
35 | wpclubmanager_wp_text_input( array(
36 | 'id' => 'wpcm_link_url',
37 | 'label' => __( 'Link URL', 'wp-club-manager' ),
38 | 'class' => 'regular-text',
39 | ) ); ?>
40 |
41 |
42 |
43 | />
44 |
45 |
46 |
30 |
31 |
32 | 'add_to_roster',
35 | 'id' => 'add_to_roster',
36 | 'post_type' => 'wpcm_roster',
37 | 'limit' => -1,
38 | 'show_option_none' => __( 'None', 'wp-club-manager' ),
39 | 'class' => 'chosen_select',
40 | 'order' => 'DESC',
41 | 'orderby' => 'date',
42 | 'echo' => false,
43 | ));
44 | ?>
45 |
46 |
47 | term_id;
72 | wp_set_post_terms( $post_id, $season, 'wpcm_season', true );
73 |
74 | $teams = wp_get_post_terms( $staff_id, 'wpcm_team' );
75 | $team = $teams[0]->term_id;
76 | wp_set_post_terms( $post_id, $team, 'wpcm_team', true );
77 | }
78 | }
79 | }
80 | }
81 |
--------------------------------------------------------------------------------
/phpcs.xml.dist:
--------------------------------------------------------------------------------
1 |
2 |
3 | .
4 | includes/WPCM_Plugin_Updater
5 | includes/libraries/tgm-plugin-activation/
6 | vendor
7 | bin
8 | release
9 | languages
10 | dist
11 | tests
12 | config
13 | build
14 | assets
15 | src
16 | static
17 | Gruntfile.js
18 | .sass-cache
19 | scoper.inc.php
20 | includes/functions-scoped.php
21 | node_modules/
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/includes/admin/class-wpcm-admin-editor.php:
--------------------------------------------------------------------------------
1 | plugin_path() . '/assets/js/admin/editor-lang.php';
53 | return $arr;
54 | }
55 |
56 | /**
57 | * Register the shortcode buttons.
58 | *
59 | * @param array $buttons
60 | * @return array
61 | */
62 | public function register_shortcode_button( $buttons ) {
63 | array_push( $buttons, 'wpcm_shortcodes_button' );
64 | return $buttons;
65 | }
66 |
67 | /**
68 | * Add the shortcode buttons to TinyMCE.
69 | *
70 | * @param array $plugin_array
71 | * @return array
72 | */
73 | public function add_shortcode_tinymce_plugin( $plugin_array ) {
74 | $plugin_array['wpcm_shortcodes_button'] = WPCM()->plugin_url() . '/assets/js/admin/editor.js';
75 | return $plugin_array;
76 | }
77 |
78 | /**
79 | * Force TinyMCE to refresh.
80 | *
81 | * @param int $ver
82 | * @return int
83 | */
84 | public function refresh_mce( $ver ) {
85 |
86 | $ver += 3;
87 | return $ver;
88 | }
89 | }
90 |
91 | new WPCM_Admin_Editor();
92 |
--------------------------------------------------------------------------------
/includes/widgets/class-wpcm-sponsors-widget.php:
--------------------------------------------------------------------------------
1 | widget_cssclass = 'wpcm-widget widget-sponsors';
31 | $this->widget_description = __( 'Display a sponsors logo.', 'wp-club-manager' );
32 | $this->widget_idbase = 'wpcm-sponsors-widget';
33 | $this->widget_name = __( 'WPCM Sponsors', 'wp-club-manager' );
34 | $this->settings = array(
35 | 'title' => array(
36 | 'type' => 'text',
37 | 'std' => __( 'Sponsors', 'wp-club-manager' ),
38 | 'label' => __( 'Title', 'wp-club-manager' ),
39 | ),
40 | 'id' => array(
41 | 'type' => 'posts_select',
42 | 'post_type' => 'wpcm_sponsor',
43 | 'show_option_none' => false,
44 | 'label' => __( 'Choose a sponsor', 'wp-club-manager' ),
45 | 'orderby' => 'post_date',
46 | 'order' => 'DESC',
47 | 'limit' => -1,
48 | 'std' => null,
49 | ),
50 | );
51 | parent::__construct();
52 | }
53 |
54 | /**
55 | * widget function.
56 | *
57 | * @param array $args
58 | * @param array $instance
59 | *
60 | * @return void
61 | * @see WP_Widget
62 | * @access public
63 | */
64 | public function widget( $args, $instance ) {
65 |
66 | $this->widget_start( $args, $instance );
67 |
68 | $link_url = get_post_meta( $instance['id'], 'wpcm_link_url', true );
69 | $link_new_window = get_post_meta( $instance['id'], 'wpcm_link_nw', true );
70 | $nw = ( $link_new_window ) ? ' target="_blank"' : ''; ?>
71 |
72 | >
73 |
74 |
75 |
76 | widget_end( $args );
78 | }
79 | }
80 |
--------------------------------------------------------------------------------
/includes/admin/post-types/meta-boxes/class-wpcm-meta-box-player-roster.php:
--------------------------------------------------------------------------------
1 |
30 |
31 |
32 | 'add_to_roster',
35 | 'id' => 'add_to_roster',
36 | 'post_type' => 'wpcm_roster',
37 | 'limit' => -1,
38 | 'show_option_none' => __( 'None', 'wp-club-manager' ),
39 | 'class' => 'chosen_select',
40 | 'order' => 'DESC',
41 | 'orderby' => 'date',
42 | 'echo' => false,
43 | ));
44 | ?>
45 |
46 |
47 | term_id;
72 | wp_set_post_terms( $post_id, $season, 'wpcm_season', true );
73 |
74 | $teams = wp_get_post_terms( $player_id, 'wpcm_team' );
75 | $team = $teams[0]->term_id;
76 | wp_set_post_terms( $post_id, $team, 'wpcm_team', true );
77 | }
78 | }
79 | }
80 | }
81 |
--------------------------------------------------------------------------------
/templates/shortcodes/matches-2.php:
--------------------------------------------------------------------------------
1 |
13 |
14 |
15 |
16 | ' . esc_html( $title ) . '' : '' ); ?>
17 |
18 |
19 |
20 | ID, 'wpcm_played', true );
24 | $timestamp = strtotime( $match->post_date );
25 | $time_format = get_option( 'time_format' );
26 | $class = wpcm_get_match_outcome( $match->ID );
27 | $comp = wpcm_get_match_comp( $match->ID );
28 | $sides = wpcm_get_match_clubs( $match->ID );
29 | $side1 = $sides[0];
30 | $side2 = $sides[1];
31 | $result = wpcm_get_match_result( $match->ID );
32 | ?>
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
--------------------------------------------------------------------------------
/includes/class-wpcm-cache-helper.php:
--------------------------------------------------------------------------------
1 | 0 ? ( parseInt( wpcm_taxonomy_ordering_data.paged ) - 1 ) * parseInt( $( '#' + wpcm_taxonomy_ordering_data.per_page_id ).val() ) : 0;
8 | const tax_table = $( '#the-list' );
9 |
10 | // If the tax table contains items.
11 | if ( ! tax_table.find( 'tr:first-child' ).hasClass( 'no-items' ) ) {
12 |
13 | tax_table.sortable({
14 | placeholder: "wpcm-drag-drop-tax-placeholder",
15 | axis: "y",
16 |
17 | // On start, set a height for the placeholder to prevent table jumps.
18 | start: function( event, ui ) {
19 | const item = $( ui.item[0] );
20 | const index = item.index();
21 | $( '.wpcm-drag-drop-tax-placeholder' ).css( 'height', item.css( 'height' ) );
22 | },
23 | // Update callback.
24 | update: function( event, ui ) {
25 | const item = $( ui.item[0] );
26 |
27 | // Hide checkbox, append a preloader.
28 | item.find( 'input[type="checkbox"]' ).hide().after( ' ' );
29 |
30 | const taxonomy_ordering_data = [];
31 |
32 | tax_table.find( 'tr.ui-sortable-handle' ).each( function() {
33 | const ele = $( this );
34 | const term_data = {
35 | term_id: ele.attr( 'id' ).replace( 'tag-', '' ),
36 | order: parseInt( ele.index() ) + 1
37 | }
38 | taxonomy_ordering_data.push( term_data );
39 | });
40 |
41 | // AJAX Data.
42 | const data = {
43 | 'action': 'wpcm_update_taxonomy_order',
44 | 'taxonomy_ordering_data': taxonomy_ordering_data,
45 | 'base_index': base_index,
46 | 'term_order_nonce': wpcm_taxonomy_ordering_data.term_order_nonce
47 | };
48 |
49 | // Run the ajax request.
50 | $.ajax({
51 | type: 'POST',
52 | url: window.ajaxurl,
53 | data: data,
54 | dataType: 'JSON',
55 | success: function( response ) {
56 | console.log( response );
57 | $( '.wpcm-taxonomy-preloader' ).remove();
58 | item.find( 'input[type="checkbox"]' ).show();
59 | }
60 | });
61 | }
62 | });
63 | }
64 | });
65 | })( jQuery );
66 |
--------------------------------------------------------------------------------
/includes/class-wpcm-autoloader.php:
--------------------------------------------------------------------------------
1 | include_path = untrailingslashit( plugin_dir_path( WPCM_PLUGIN_FILE ) ) . '/includes/';
39 | }
40 |
41 | /**
42 | * Take a class name and turn it into a file name
43 | *
44 | * @param string $class
45 | * @return string
46 | */
47 | private function get_file_name_from_class( $class ) {
48 | return 'class-' . str_replace( '_', '-', strtolower( $class ) ) . '.php';
49 | }
50 |
51 | /**
52 | * Include a class file
53 | *
54 | * @param string $path
55 | * @return bool successful or not
56 | */
57 | private function load_file( $path ) {
58 | if ( $path && is_readable( $path ) ) {
59 | include_once $path;
60 | return true;
61 | }
62 | return false;
63 | }
64 |
65 | /**
66 | * Auto-load WC classes on demand to reduce memory consumption.
67 | *
68 | * @param string $class
69 | */
70 | public function autoload( $class ) {
71 | $class = strtolower( $class );
72 | $file = $this->get_file_name_from_class( $class );
73 | $path = '';
74 |
75 | if ( strpos( $class, 'wpcm_shortcode_' ) === 0 ) {
76 | $path = $this->include_path . 'shortcodes/';
77 | } elseif ( strpos( $class, 'wpcm_meta_box' ) === 0 ) {
78 | $path = $this->include_path . 'admin/post-types/meta-boxes/';
79 | } elseif ( strpos( $class, 'wpcm_admin' ) === 0 ) {
80 | $path = $this->include_path . 'admin/';
81 | }
82 |
83 | if ( empty( $path ) || ( ! $this->load_file( $path . $file ) && strpos( $class, 'wpcm_' ) === 0 ) ) {
84 | $this->load_file( $this->include_path . $file );
85 | }
86 | }
87 | }
88 |
89 | new WPCM_Autoloader();
90 |
--------------------------------------------------------------------------------
/includes/admin/class-wpcm-admin-status.php:
--------------------------------------------------------------------------------
1 | $value ) {
76 |
77 | if ( ! in_array( $value, array( '.', '..' ) ) ) {
78 |
79 | if ( is_dir( $template_path . DIRECTORY_SEPARATOR . $value ) ) {
80 | $sub_files = self::scan_template_files( $template_path . DIRECTORY_SEPARATOR . $value );
81 | foreach ( $sub_files as $sub_file ) {
82 | $result[] = $value . DIRECTORY_SEPARATOR . $sub_file;
83 | }
84 | } else {
85 | $result[] = $value;
86 | }
87 | }
88 | }
89 | }
90 | return $result;
91 | }
92 | }
93 |
--------------------------------------------------------------------------------
/templates/shortcodes/league-table.php:
--------------------------------------------------------------------------------
1 |
13 |
14 |
15 |
16 | ' . esc_html( $title ) . '' : '' ); ?>
17 |
18 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
--------------------------------------------------------------------------------
/includes/admin/wpcm-admin-functions.php:
--------------------------------------------------------------------------------
1 | plugin_path() . '/templates/' . $file;
93 | }
94 | }
95 |
96 | return $template;
97 | }
98 | }
99 |
100 | new WPCM_Template_Loader();
101 |
--------------------------------------------------------------------------------
/templates/shortcodes/map-venue.php:
--------------------------------------------------------------------------------
1 |
14 |
15 |
16 |
17 | ' . esc_html( $title ) . '' : '' );
19 |
20 | if ( 'osm' === $service ) {
21 | ?>
22 |
23 |
24 |
25 |
65 |
66 |
69 |
70 |
71 |
72 |
75 |
76 |
77 |
--------------------------------------------------------------------------------
/templates/single-player/stats-table.php:
--------------------------------------------------------------------------------
1 | ID, '_wpcm_custom_player_stats', true ); ?>
24 |
25 |
26 |
27 |
28 | $val ) {
30 |
31 | if ( get_option( 'wpcm_show_stats_' . $key ) == 'yes' && array_key_exists( $key, $custom_stats ) ) {
32 | ?>
33 |
34 |
35 |
36 |
40 |
41 |
42 |
43 |
44 | $val ) {
46 |
47 | if ( 'appearances' === $key ) {
48 |
49 | if ( get_option( 'wpcm_show_stats_appearances' ) == 'yes' && array_key_exists( 'appearances', $custom_stats ) ) {
50 |
51 | if ( get_option( 'wpcm_show_stats_subs' ) == 'yes' ) {
52 | $subs = get_player_subs_total( $post->ID, $season, $team );
53 | if ( $subs > 0 ) {
54 | $sub = ' (' . $subs . ') ';
55 | } else {
56 | $sub = '';
57 | }
58 | }
59 | ?>
60 |
61 |
62 |
63 |
73 |
74 |
75 |
76 |
81 |
82 |
83 |
84 |
89 |
90 |
91 |
92 |
93 |
--------------------------------------------------------------------------------