page_title = __( 'Geolocation', 'wpconsent-cookies-banner-privacy-suite' ); parent::__construct(); } /** * Override the output method so we can add our form markup for this page. * * @return void */ public function output() { $this->output_header(); ?>
output_content(); do_action( "wpconsent_admin_page_content_{$this->page_slug}", $this ); ?>
' . esc_html__( 'Upgrade to WPConsent PRO today and personalize the display of your cookie banner to show only in the specific countries or regions you choose.', 'wpconsent-cookies-banner-privacy-suite' ) . '

', array( 'text' => esc_html__( 'Upgrade to PRO and Unlock "Geolocation"', 'wpconsent-cookies-banner-privacy-suite' ), 'url' => esc_url( wpconsent_utm_url( 'https://wpconsent.com/lite/', 'geolocation-page', 'main' ) ), ), array( 'text' => esc_html__( 'Learn more about all the features', 'wpconsent-cookies-banner-privacy-suite' ), 'url' => esc_url( wpconsent_utm_url( 'https://wpconsent.com/lite/', 'geolocation-page', 'features' ) ), ) ); ?>
output_location_groups_management(); ?>
get_location_groups(); ?>
output_predefined_rules_metabox(); ?> output_location_groups_list( $location_groups ); ?>
get_location_groups_list_content( $location_groups ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } /** * Get the content for the location groups list. * * @param array $location_groups Array of location groups. * * @return string */ public function get_location_groups_list_content( $location_groups ) { if ( empty( $location_groups ) ) { return '

' . __( 'No location groups have been created yet. Choose one of the pre-configured templates or create a custom rule.', 'wpconsent-cookies-banner-privacy-suite' ) . '

'; } ob_start(); ?> $group ) { // If the group is not an array, skip it. if ( ! is_array( $group ) ) { continue; } ?>
format_locations_display( $group['locations'] ), array( 'span' => array( 'class' => array() ) ) ); ?>
get_predefined_rules_content(); $this->metabox( __( 'Location-based Rules', 'wpconsent-cookies-banner-privacy-suite' ), $content, __( 'Quickly add predefined rules for common privacy regulations. Each rule will automatically configure the relevant countries and settings for the location.', 'wpconsent-cookies-banner-privacy-suite' ) ); } /** * Get predefined rules content. * * @return string */ public function get_predefined_rules_content() { ob_start(); ?>

'GDPR Compliance', 'locations' => 'Europe', 'type_of_consent' => 'GDPR', 'enable_script_blocking' => true, 'show_banner' => true, 'enable_consent_floating' => true, ), array( 'name' => 'CCPA', 'locations' => 'California, USA', 'type_of_consent' => 'CCPA', 'enable_script_blocking' => true, 'show_banner' => true, 'enable_consent_floating' => true, 'consent_mode' => 'optout', ), ); } }