芝麻web文件管理V1.00
编辑当前文件:/var/www/cognitio.in/wp-content/plugins/popup-maker/includes/functions/newsletter.php
get_providers(); return isset( $providers[ $provider_id ] ) ? $providers[ $provider_id ] : false; } /** * @param string $provider_id * @param string $context * @param array $values * * @return mixed|string */ function pum_get_newsletter_provider_message( $provider_id, $context, $values = [] ) { $provider = pum_get_newsletter_provider( $provider_id ); $default = pum_get_newsletter_default_messages( $context ); if ( ! $provider ) { return $default; } $message = $provider->get_message( $context, $values ); return ! empty( $message ) ? $message : $default; } /** * Gets default messages. * * @param null $context * * @return array|mixed|string */ function pum_get_newsletter_default_messages( $context = null ) { $messages = [ 'success' => pum_get_option( 'default_success_message', __( 'You have been subscribed!', 'popup-maker' ) ), 'double_opt_in_success' => pum_get_option( 'default_double_opt_in_success_message', __( 'Please check your email and confirm your subscription.', 'popup-maker' ) ), 'error' => pum_get_option( 'default_error_message', __( 'Error occurred when subscribing. Please try again.', 'popup-maker' ) ), 'already_subscribed' => pum_get_option( 'default_already_subscribed_message', __( 'You are already a subscriber.', 'popup-maker' ) ), 'empty_email' => pum_get_option( 'default_empty_email_message', __( 'Please enter a valid email.', 'popup-maker' ) ), 'invalid_email' => pum_get_option( 'default_invalid_email_message', __( 'Email provided is not a valid email address.', 'popup-maker' ) ), 'consent_required' => pum_get_option( 'default_consent_required_message', __( 'Email provided is not a valid email address.', 'popup-maker' ) ), ]; if ( $context ) { return isset( $messages[ $context ] ) ? $messages[ $context ] : ''; } return $messages; } /** * @return array */ function pum_get_newsletter_admin_localized_vars() { return [ 'default_provider' => pum_get_option( 'newsletter_default_provider', pum_get_option( 'newsletter_default', '' ) ), ]; }