site_url(), 'admin_url' => admin_url(), 'nonce' => wp_create_nonce( 'wp_rest' ), 'date_format' => get_option( 'date_format' ), 'date_format_string' => date_i18n( get_option( 'date_format' ) ), 'time_format' => get_option( 'time_format' ), 'time_format_string' => date_i18n( get_option( 'time_format' ) ), 'start_of_week' => get_option( 'start_of_week', 0 ), 'current_user_id' => get_current_user_id(), 'currency_list' => booktics_get_currencies(), 'bookticsPro' => class_exists('BookticsPro'), 'user_role' => $current_user->roles, ]; return apply_filters( 'booktics_admin_localize', $data ); } /** * Get frontend localize data * * @return array Collection localize data */ public static function get_frontend() { $data = [ 'site_url' => site_url(), 'nonce' => wp_create_nonce( 'wp_rest' ), 'date_format' => get_option( 'date_format' ), 'time_format' => get_option( 'time_format' ), 'current_user_id' => get_current_user_id(), 'start_of_week' => get_option( 'start_of_week', 0 ), 'locale_name' => strtolower( str_replace( '_', '-', get_locale() ) ), 'currency_list' => booktics_get_currencies(), ]; return apply_filters( 'booktics_frontend_localize', $data ); } }