Submit
Path:
~
/
/
proc
/
thread-self
/
root
/
home
/
getwphos
/
www
/
ppine
/
wp-content
/
plugins
/
trx_addons
/
components
/
cpt
/
sport
/
File Content:
sport-sc-gutenberg.php
<?php /** * ThemeREX Addons: Sports Reviews Management (SRM). * Support different sports, championships, rounds, matches and players. * (Gutenberg support) * * @package ThemeREX Addons * @since v1.6.17 */ // Don't load directly if ( ! defined( 'TRX_ADDONS_VERSION' ) ) { exit; } // Gutenberg Block //------------------------------------------------------ // Add scripts and styles for the editor if ( ! function_exists( 'trx_addons_gutenberg_sc_matches_editor_assets' ) ) { add_action( 'enqueue_block_editor_assets', 'trx_addons_gutenberg_sc_matches_editor_assets', TRX_ADDONS_GUTENBERG_EDITOR_BLOCK_REGISTRATION_PRIORITY ); function trx_addons_gutenberg_sc_matches_editor_assets() { if ( trx_addons_exists_gutenberg() && trx_addons_get_setting( 'allow_gutenberg_blocks' ) ) { // Scripts wp_enqueue_script( 'trx-addons-gutenberg-editor-block-matches', trx_addons_get_file_url( TRX_ADDONS_PLUGIN_CPT . 'sport/gutenberg/matches.gutenberg-editor.js' ), trx_addons_block_editor_dependencis(), filemtime( trx_addons_get_file_dir( TRX_ADDONS_PLUGIN_CPT . 'sport/gutenberg/matches.gutenberg-editor.js' ) ), true ); } } } // Block register if ( ! function_exists( 'trx_addons_sc_matches_add_in_gutenberg' ) ) { add_action( 'init', 'trx_addons_sc_matches_add_in_gutenberg' ); function trx_addons_sc_matches_add_in_gutenberg() { if ( trx_addons_exists_gutenberg() && trx_addons_get_setting( 'allow_gutenberg_blocks' ) ) { register_block_type( 'trx-addons/matches', apply_filters('trx_addons_gb_map', array( 'attributes' => array_merge( array( 'type' => array( 'type' => 'string', 'default' => 'default', ), 'sport' => array( 'type' => 'string', 'default' => trx_addons_get_option( 'sport_favorite' ), ), 'competition' => array( 'type' => 'string', 'default' => '', ), 'round' => array( 'type' => 'string', 'default' => '', ), 'main_matches' => array( 'type' => 'boolean', 'default' => false, ), 'position' => array( 'type' => 'string', 'default' => 'top', ), 'slider' => array( 'type' => 'boolean', 'default' => false, ), ), trx_addons_gutenberg_get_param_query(), ! apply_filters( 'trx_addons_filter_add_title_param', true, 'trx-addons/matches' ) ? array() : trx_addons_gutenberg_get_param_title(), ! apply_filters( 'trx_addons_filter_add_title_param', true, 'trx-addons/matches' ) ? array() : trx_addons_gutenberg_get_param_button(), trx_addons_gutenberg_get_param_id() ), 'render_callback' => 'trx_addons_gutenberg_sc_matches_render_block', ), 'trx-addons/matches' ) ); } } } // Block render if ( ! function_exists( 'trx_addons_gutenberg_sc_matches_render_block' ) ) { function trx_addons_gutenberg_sc_matches_render_block( $attributes = array() ) { return trx_addons_sc_matches( $attributes ); } } // Return list of allowed layouts if ( ! function_exists( 'trx_addons_gutenberg_sc_matches_get_layouts' ) ) { add_filter( 'trx_addons_filter_gutenberg_sc_layouts', 'trx_addons_gutenberg_sc_matches_get_layouts', 10, 1 ); function trx_addons_gutenberg_sc_matches_get_layouts( $array = array() ) { $array['trx_sc_matches'] = apply_filters( 'trx_addons_sc_type', array( 'default' => esc_html__( 'Default', 'trx_addons' ), ), 'trx_sc_matches' ); return $array; } } // Gutenberg Block //------------------------------------------------------ // Add scripts and styles for the editor if ( ! function_exists( 'trx_addons_gutenberg_sc_points_editor_assets' ) ) { add_action( 'enqueue_block_editor_assets', 'trx_addons_gutenberg_sc_points_editor_assets' ); function trx_addons_gutenberg_sc_points_editor_assets() { if ( trx_addons_exists_gutenberg() && trx_addons_get_setting( 'allow_gutenberg_blocks' ) ) { // Scripts wp_enqueue_script( 'trx-addons-gutenberg-editor-block-points', trx_addons_get_file_url( TRX_ADDONS_PLUGIN_CPT . 'sport/gutenberg/points.gutenberg-editor.js' ), trx_addons_block_editor_dependencis(), filemtime( trx_addons_get_file_dir( TRX_ADDONS_PLUGIN_CPT . 'sport/gutenberg/points.gutenberg-editor.js' ) ), true ); } } } // Block register if ( ! function_exists( 'trx_addons_sc_points_add_in_gutenberg' ) ) { add_action( 'init', 'trx_addons_sc_points_add_in_gutenberg' ); function trx_addons_sc_points_add_in_gutenberg() { if ( trx_addons_exists_gutenberg() && trx_addons_get_setting( 'allow_gutenberg_blocks' ) ) { register_block_type( 'trx-addons/points', apply_filters('trx_addons_gb_map', array( 'attributes' => array_merge( array( 'type' => array( 'type' => 'string', 'default' => 'default', ), 'sport' => array( 'type' => 'string', 'default' => trx_addons_get_option( 'sport_favorite' ), ), 'competition' => array( 'type' => 'string', 'default' => '', ), 'logo' => array( 'type' => 'boolean', 'default' => false, ), 'accented_top' => array( 'type' => 'number', 'default' => 3, ), 'accented_bottom' => array( 'type' => 'number', 'default' => 3, ), ), ! apply_filters( 'trx_addons_filter_add_title_param', true, 'trx-addons/points' ) ? array() : trx_addons_gutenberg_get_param_title(), ! apply_filters( 'trx_addons_filter_add_title_param', true, 'trx-addons/points' ) ? array() : trx_addons_gutenberg_get_param_button(), trx_addons_gutenberg_get_param_id() ), 'render_callback' => 'trx_addons_gutenberg_sc_points_render_block', ), 'trx-addons/points' ) ); } } } // Block render if ( ! function_exists( 'trx_addons_gutenberg_sc_points_render_block' ) ) { function trx_addons_gutenberg_sc_points_render_block( $attributes = array() ) { return trx_addons_sc_points( $attributes ); } } // Return list of allowed layouts if ( ! function_exists( 'trx_addons_gutenberg_sc_points_get_layouts' ) ) { add_filter( 'trx_addons_filter_gutenberg_sc_layouts', 'trx_addons_gutenberg_sc_points_get_layouts', 10, 1 ); function trx_addons_gutenberg_sc_points_get_layouts( $array = array() ) { $array['trx_sc_points'] = apply_filters( 'trx_addons_sc_type', array( 'default' => esc_html__( 'Default', 'trx_addons' ), ), 'trx_sc_points' ); return $array; } } // Add shortcode's specific vars to the JS storage if ( ! function_exists( 'trx_addons_gutenberg_sc_sport_params' ) ) { add_filter( 'trx_addons_filter_gutenberg_sc_params', 'trx_addons_gutenberg_sc_sport_params' ); function trx_addons_gutenberg_sc_sport_params( $vars = array() ) { if ( trx_addons_exists_gutenberg() && trx_addons_get_setting( 'allow_gutenberg_blocks' ) ) { // If editor is active now $is_edit_mode = trx_addons_is_post_edit(); $vars['sc_sport_default'] = trx_addons_get_option( 'sport_favorite' ); // Return list of sports $vars['sc_sports_list'] = !$is_edit_mode ? array() : trx_addons_get_list_terms( false, TRX_ADDONS_CPT_COMPETITIONS_TAXONOMY ); // Return list of competition $rounds_list = array(); $vars['sc_sport_competitions_list'] = array(); if ($is_edit_mode) { foreach ( $vars['sc_sports_list'] as $key => $value ) { $vars['sc_sport_competitions_list'][ $key ] = trx_addons_get_list_posts( false, array( 'post_type' => TRX_ADDONS_CPT_COMPETITIONS_PT, 'taxonomy' => TRX_ADDONS_CPT_COMPETITIONS_TAXONOMY, 'taxonomy_value' => $key, 'meta_key' => 'trx_addons_competition_date', 'orderby' => 'meta_value', 'order' => 'ASC', 'not_selected' => false, ) ); foreach ( $vars['sc_sport_competitions_list'][ $key ] as $key2 => $value2 ) { $rounds_list[ $key2 ] = trx_addons_get_list_posts( false, array( 'post_type' => TRX_ADDONS_CPT_ROUNDS_PT, 'post_parent' => $key2, 'meta_key' => 'trx_addons_round_date', 'orderby' => 'meta_value', 'order' => 'ASC', 'not_selected' => false, ) ); } } } // Return list of rounds $vars['sc_sport_rounds_list'] = array( 'last' => esc_html__( 'Last round', 'trx_addons' ), 'next' => esc_html__( 'Next round', 'trx_addons' ), ); $vars['sc_sport_rounds_list'] = !$is_edit_mode ? array() : trx_addons_array_merge( $vars['sc_sport_rounds_list'], $rounds_list ); // Return list of positions $vars['sc_sport_positions'] = !$is_edit_mode ? array() : trx_addons_get_list_sc_matches_positions(); return $vars; } } }
Submit
FILE
FOLDER
Name
Size
Permission
Action
gutenberg
---
0755
players.png
2088 bytes
0644
points.png
1347 bytes
0644
sport-sc-elementor.php
13902 bytes
0644
sport-sc-gutenberg.php
9013 bytes
0644
sport-sc-vc.php
10937 bytes
0644
sport-sc.php
4348 bytes
0644
sport.admin.js
3433 bytes
0644
sport.competitions.php
20138 bytes
0644
sport.css
11248 bytes
0644
sport.css.map
7108 bytes
0644
sport.elementor.editor.js
3730 bytes
0644
sport.js
464 bytes
0644
sport.matches.php
21214 bytes
0644
sport.php
19712 bytes
0644
sport.players.php
13279 bytes
0644
sport.png
2650 bytes
0644
sport.responsive.css
2090 bytes
0644
sport.responsive.css.map
1266 bytes
0644
sport.responsive.scss
2014 bytes
0644
sport.rounds.php
12652 bytes
0644
sport.scss
9454 bytes
0644
tpl.archive-item.php
5221 bytes
0644
tpl.archive.php
1983 bytes
0644
tpl.sc_matches.default-main.php
4373 bytes
0644
tpl.sc_matches.default-other.php
3346 bytes
0644
tpl.sc_matches.default.php
5000 bytes
0644
tpl.sc_points.default.php
3575 bytes
0644
tpl.single.competitions.php
7880 bytes
0644
tpl.single.matches.php
8215 bytes
0644
tpl.single.php
2950 bytes
0644
tpl.single.players.php
7094 bytes
0644
tpl.single.rounds.php
5039 bytes
0644
N4ST4R_ID | Naxtarrr