From d20c491cc2ad1f9e68b6b2e0e4b8a8d66776ddf3 Mon Sep 17 00:00:00 2001 From: Warwick Date: Tue, 7 Jan 2025 14:43:09 +0200 Subject: [PATCH] Hiding the map vars --- includes/classes/admin/class-settings.php | 16 +++++----------- includes/classes/blocks/class-registration.php | 6 ------ 2 files changed, 5 insertions(+), 17 deletions(-) diff --git a/includes/classes/admin/class-settings.php b/includes/classes/admin/class-settings.php index 37d4dcdc..bc998f44 100644 --- a/includes/classes/admin/class-settings.php +++ b/includes/classes/admin/class-settings.php @@ -157,17 +157,6 @@ public function create_settings_page() { //Post type pages add_action( 'lsx_to_framework_post_type_tab_content', array( $this, 'post_type_map_settings' ), 10, 2 ); - - /*if ( ! empty( tour_operator()->legacy->post_types ) ) { - foreach ( tour_operator()->legacy->post_types as $post_type => $label ) { - if ( isset( tour_operator()->legacy->options[ $post_type ]['googlemaps_marker'] ) && '' !== tour_operator()->legacy->options[ $post_type ]['googlemaps_marker'] ) { - tour_operator()->legacy->markers->post_types[ $post_type ] = tour_operator()->legacy->options[ $post_type ]['googlemaps_marker']; - } else { - tour_operator()->legacy->markers->post_types[ $post_type ] = LSX_TO_URL . 'assets/img/markers/' . $post_type . '-marker.png'; - } - add_action( 'lsx_to_framework_' . $post_type . '_tab_content', array( $this, 'post_type_map_settings' ), 10, 2 ); - } - }*/ } } @@ -251,6 +240,7 @@ public function fusion_table_settings( $tab = 'general' ) { public function map_placeholder_settings( $tab = 'general' ) { if ( 'placeholders' === $tab ) { $settings = $this->get_settings_fields(); + echo wp_kses_post( $this->output_fields( $settings['placeholder'] ) ); } } @@ -277,6 +267,10 @@ public function api_settings( $tab = 'general' ) { public function post_type_map_settings( $tab, $post_type ) { $settings = $this->get_settings_fields(); if ( 'placeholder' === $tab ) { + if ( ! in_array( $post_type, [ 'accommodation', 'destination', 'tour' ] ) ) { + unset( $settings['post_types']['placeholder']['map_placeholder_enabled'] ); + unset( $settings['post_types']['placeholder']['map_placeholder'] ); + } echo wp_kses_post( $this->output_fields( $settings['post_types'][ $tab ], $post_type ) ); } if ( 'template' === $tab ) { diff --git a/includes/classes/blocks/class-registration.php b/includes/classes/blocks/class-registration.php index c7f490e3..4a6a3bdd 100644 --- a/includes/classes/blocks/class-registration.php +++ b/includes/classes/blocks/class-registration.php @@ -272,8 +272,6 @@ public function query_args_filter( $query, $block ) { $this->onsale = false; } - do_action( 'qm/debug', $query ); - return $query; } @@ -310,8 +308,6 @@ public function maybe_hide_varitaion( $block_content, $parsed_block, $block_obj return $block_content; } - do_action( 'qm/debug', $matches ); - if ( in_array( 'travel-information', $matches ) ) { return $block_content; } @@ -395,8 +391,6 @@ public function maybe_hide_varitaion( $block_content, $parsed_block, $block_obj foreach ( $key_array as $meta_key ) { $value = lsx_to_custom_field_query( $meta_key, '', '', false ); - - do_action( 'qm/debug', $value ); // we need to see if the posts exist before we can use them if ( stripos( $meta_key, '_to_' ) && 0 === $this->post_ids_exist( $value ) ) {