true, ) ); $excluded_pages = $this->get_excluded( get_option( 'admon_excluded_pages' ) ); $excluded_routes = $this->get_excluded( get_option( 'admon_excluded_routes' ) ); wp_localize_script( 'admon-settings-page', 'admon_settings', array( 'logo' => ADMON_IMG . '/tadamus-logo.png', 'nonce' => wp_create_nonce( 'admon_settings' ), 'front_end' => esc_attr( get_option( 'admon_front_end' ) ), 'front_end_link' => esc_attr( get_option( 'admon_front_end_link' ) ), 'excluded_pages' => $excluded_pages, 'rest_api' => esc_attr( get_option( 'admon_rest_api' ) ), 'rest_api_link' => esc_attr( get_option( 'admon_rest_api_link' ) ), 'delete_data' => esc_attr( get_option( 'admon_delete_data' ) ), ) ); remove_all_actions( 'admin_notices' ); echo '
'; } /** * Retrieve the excluded pages and format them in a string separated by commas * * @since 1.0.0 * * @param mixed $option The WordPress Option that contains the pages. * * @return string */ private function get_excluded( mixed $option ): string { $excluded_pages = ''; if ( $option ) { $array_excluded_pages = json_decode( $option, true ); $excluded_pages = implode( ',', $array_excluded_pages ); } return $excluded_pages; } } new Settings_Page(); }