window.location.href = "' . esc_url( get_page_link( $visibility_page_id ) ) . '";'; // Exit to prevent further processing. exit(); } } /** * Enqueue asset files. * * @since 2.8.0 */ public function enqueue_asset_files() { // Check if assets should be excluded for the current post type. if ( UAGB_Admin_Helper::should_exclude_assets_for_cpt() ) { return; // Early return to prevent loading assets. } $current_page_id = get_the_ID(); $visibility_page_id = intval( UAGB_Admin_Helper::get_admin_settings_option( 'uag_visibility_page', false ) ); if ( $visibility_page_id === $current_page_id ) { wp_enqueue_style( 'uagb-style-visibility', // Handle. UAGB_URL . 'assets/css/visibility.min.css', array(), UAGB_VER ); } } } /** * Prepare if class 'UAGB_Visibility' exist. * Kicking this off by calling 'get_instance()' method */ UAGB_Visibility::get_instance();