*/ function glovario_pro_waitlist_urls() { $urls = array( 'en' => 'https://tally.so/r/1A1A6W', 'it' => 'https://tally.so/r/dW5WvA', 'es' => 'https://tally.so/r/ob4bvV', 'fr' => 'https://tally.so/r/VLkLDv', 'de' => 'https://tally.so/r/Pdadkb', 'pt' => 'https://tally.so/r/LZQZoG', 'pt_PT' => 'https://tally.so/r/LZQZoG', 'pt_BR' => 'https://tally.so/r/pblbZV', ); /** * Filters the feedback survey forms by language. * * @param array $urls Locale or language code => form URL. */ $urls = apply_filters( 'glovario_pro_waitlist_urls', $urls ); return is_array( $urls ) ? $urls : array(); } /** * Feedback survey link in the administrator's language. * * GLOVARIO_PRO_WAITLIST_URL (wp-config.php) overrides the per-language forms. The * link is only shown to the administrator; nothing is requested from it. * * @param string|null $locale Locale to match; defaults to the current user's. * @return string */ function glovario_get_pro_waitlist_url( $locale = null ) { $locale = $locale ? (string) $locale : get_user_locale(); $url = defined( 'GLOVARIO_PRO_WAITLIST_URL' ) ? (string) GLOVARIO_PRO_WAITLIST_URL : ''; if ( '' === $url ) { $urls = glovario_pro_waitlist_urls(); $language = strtolower( strtok( $locale, '_' ) ); foreach ( array( $locale, $language, 'en' ) as $candidate ) { if ( ! empty( $urls[ $candidate ] ) && is_string( $urls[ $candidate ] ) ) { $url = $urls[ $candidate ]; break; } } } /** * Filters the feedback survey link. * * @param string $url Survey URL, or an empty string for none. * @param string $locale Locale the link was chosen for. */ return esc_url_raw( (string) apply_filters( 'glovario_pro_waitlist_url', $url, $locale ) ); }