/home/techb158/primomovers.ca/wp-content/plugins/everest-forms/includes
NameSizeModeActions
abilities/-0755rm
abstracts/-0755rm
admin/-0755rm
blocks/-0755rm
elementor/-0755rm
export/-0755rm
fields/-0755rm
Helpers/-0755rm
Integrations/-0755rm
interfaces/-0755rm
libraries/-0755rm
log-handlers/-0755rm
RestApi/-0755rm
shortcodes/-0755rm
stats/-0755rm
templates/-0755rm
traits/-0755rm
class-everest-forms.php151470644editdlrm
class-evf-addon-upsell.php105920644editdlrm
class-evf-ajax.php788220644editdlrm
class-evf-autoloader.php19680644editdlrm
class-evf-background-process-import-entries.php52760644editdlrm
class-evf-background-updater.php33510644editdlrm
class-evf-cache-helper.php24160644editdlrm
class-evf-cron.php18710644editdlrm
class-evf-deprecated-action-hooks.php40080644editdlrm
class-evf-deprecated-filter-hooks.php37290644editdlrm
class-evf-email-entries-report.php118780644editdlrm
class-evf-emails.php201340644editdlrm
class-evf-fields.php48280644editdlrm
class-evf-form-handler.php167800644editdlrm
class-evf-form-task.php954660644editdlrm
class-evf-forms-features.php19570644editdlrm
class-evf-frontend-scripts.php173990644editdlrm
class-evf-install.php215130644editdlrm
class-evf-integrations.php69430644editdlrm
class-evf-log-levels.php26740644editdlrm
class-evf-logger.php84710644editdlrm
class-evf-post-types.php52540644editdlrm
class-evf-privacy.php75870644editdlrm
class-evf-report-cron.php66890644editdlrm
class-evf-reporting.php12010644editdlrm
class-evf-session-handler.php82110644editdlrm
class-evf-shortcodes.php20840644editdlrm
class-evf-smart-tags.php207420644editdlrm
class-evf-template-loader.php146430644editdlrm
class-evf-validation.php9340644editdlrm
evf-conditional-functions.php12420644editdlrm
evf-core-functions.php2015750644editdlrm
evf-deprecated-functions.php63650644editdlrm
evf-entry-functions.php93670644editdlrm
evf-formatting-functions.php159580644editdlrm
evf-notice-functions.php63780644editdlrm
evf-template-functions.php12250644editdlrm
evf-template-hooks.php4390644editdlrm
evf-update-functions.php102030644editdlrm
Edit: /home/techb158/primomovers.ca/wp-content/plugins/everest-forms/includes/evf-notice-functions.php (6378B)
session->get( 'evf_notices', array() ); if ( isset( $all_notices[ $notice_type ] ) ) { $notice_count = count( $all_notices[ $notice_type ] ); } elseif ( empty( $notice_type ) ) { foreach ( $all_notices as $notices ) { $notice_count += count( $notices ); } } return $notice_count; } /** * Check if a notice has already been added. * * @since 1.0.0 * @param string $message The text to display in the notice. * @param string $notice_type Optional. The name of the notice type - either error, success or notice. * @return bool */ function evf_has_notice( $message, $notice_type = 'success' ) { if ( ! did_action( 'everest_forms_init' ) ) { evf_doing_it_wrong( __FUNCTION__, __( 'This function should not be called before everest_forms_init.', 'everest-forms' ), '1.0' ); return false; } $notices = evf()->session->get( 'evf_notices', array() ); $notices = isset( $notices[ $notice_type ] ) ? $notices[ $notice_type ] : array(); return array_search( $message, $notices, true ) !== false; } /** * Add and store a notice. * * @since 1.0.0 * @param string $message The text to display in the notice. * @param string $notice_type Optional. The name of the notice type - either error, success or notice. */ function evf_add_notice( $message, $notice_type = 'success' ) { if ( ! did_action( 'everest_forms_init' ) ) { evf_doing_it_wrong( __FUNCTION__, __( 'This function should not be called before everest_forms_init.', 'everest-forms' ), '1.0' ); return; } if ( evf_is_amp() ) { return; } $notices = evf()->session->get( 'evf_notices', array() ); // Backward compatibility. if ( 'success' === $notice_type ) { $message = apply_filters( 'everest_forms_add_message', $message ); } $notices[ $notice_type ][] = apply_filters( 'everest_forms_add_' . $notice_type, $message ); evf()->session->set( 'evf_notices', $notices ); } /** * Set all notices at once. * * @since 1.0.0 * @param mixed $notices Array of notices. */ function evf_set_notices( $notices ) { if ( ! did_action( 'everest_forms_init' ) ) { evf_doing_it_wrong( __FUNCTION__, __( 'This function should not be called before everest_forms_init.', 'everest-forms' ), '1.0' ); return; } evf()->session->set( 'evf_notices', $notices ); } /** * Unset all notices. * * @since 1.0.0 */ function evf_clear_notices() { if ( ! did_action( 'everest_forms_init' ) ) { evf_doing_it_wrong( __FUNCTION__, __( 'This function should not be called before everest_forms_init.', 'everest-forms' ), '1.0' ); return; } evf()->session->set( 'evf_notices', null ); } /** * Prints messages and errors which are stored in the session, then clears them. * * @since 1.0.0 * * @param array $form_data Prepared form settings. */ function evf_print_notices( $form_data = array() ) { if ( ! did_action( 'everest_forms_init' ) ) { evf_doing_it_wrong( __FUNCTION__, __( 'This function should not be called before everest_forms_init.', 'everest-forms' ), '1.0' ); return; } $form_id = isset( $form_data['id'] ) ? absint( $form_data['id'] ) : 0; $all_notices = evf()->session->get( 'evf_notices', array() ); $notice_types = apply_filters( 'everest_forms_notice_types', array( 'error', 'success', 'notice' ) ); // Skips notice print if it isn't the right form. if ( isset( $_REQUEST['everest_forms']['id'] ) && ( (int) $form_id !== (int) $_REQUEST['everest_forms']['id'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification return; } foreach ( $notice_types as $notice_type ) { if ( evf_notice_count( $notice_type ) > 0 ) { foreach ( $all_notices[ $notice_type ] as $key => $message ) { $all_notices[ $notice_type ][ $key ] = evf_string_translation( $form_id, 'notice_message_' . $notice_type, $message ); } evf_get_template( "notices/{$notice_type}.php", array( 'messages' => array_filter( $all_notices[ $notice_type ] ), ) ); } } evf_clear_notices(); } add_action( 'everest_forms_display_fields_before', 'evf_print_notices', 10 ); /** * Print a single notice immediately. * * @since 1.0.0 * @param string $message The text to display in the notice. * @param string $notice_type Optional. The name of the notice type - either error, success or notice. */ function evf_print_notice( $message, $notice_type = 'success' ) { if ( 'success' === $notice_type ) { $message = apply_filters( 'everest_forms_add_message', $message ); } evf_get_template( "notices/{$notice_type}.php", array( 'messages' => array( apply_filters( 'everest_forms_add_' . $notice_type, $message ) ), ) ); } /** * Returns all queued notices, optionally filtered by a notice type. * * @since 1.0.0 * @param string $notice_type Optional. The name of the notice type - either error, success or notice. * @return array|mixed */ function evf_get_notices( $notice_type = '' ) { if ( ! did_action( 'everest_forms_init' ) ) { evf_doing_it_wrong( __FUNCTION__, __( 'This function should not be called before everest_forms_init.', 'everest-forms' ), '1.0' ); return; } $all_notices = evf()->session->get( 'evf_notices', array() ); if ( empty( $notice_type ) ) { $notices = $all_notices; } elseif ( isset( $all_notices[ $notice_type ] ) ) { $notices = $all_notices[ $notice_type ]; } else { $notices = array(); } return $notices; } /** * Add notices for WP Errors. * * @param WP_Error $errors Errors. */ function evf_add_wp_error_notices( $errors ) { if ( is_wp_error( $errors ) && $errors->get_error_messages() ) { foreach ( $errors->get_error_messages() as $error ) { evf_add_notice( $error, 'error' ); } } }