/home/vianto5/cititower.mx/wp-content/plugins/wpforms/src/Pro/Forms/Fields/Pagebreak
NameSizeModeActions
Field.php149090644editdlrm
Frontend.php49890644editdlrm
Edit: /home/vianto5/cititower.mx/wp-content/plugins/wpforms/src/Pro/Forms/Fields/Pagebreak/Frontend.php (4989B)
has_page_button( 'prev', $prev ) && ! $this->has_page_button( 'next', $next ) ) { return; } printf( '
', sanitize_html_class( $this->get_align_buttons_class() ) ); $this->display_page_button( 'prev', $prev, $form_data ); $this->display_page_button( 'next', $next, $form_data ); echo '
'; } /** * Get align buttons class. * * @since 1.8.6 * * @return string */ private function get_align_buttons_class(): string { $frontend_obj = wpforms()->obj( 'frontend' ); $top = ! empty( $frontend_obj->pages['top'] ) ? $frontend_obj->pages['top'] : []; return ! empty( $top['nav_align'] ) ? 'wpforms-pagebreak-' . $top['nav_align'] : 'wpforms-pagebreak-center'; } /** * Display page button. * * @since 1.8.1 * * @param string $action Action, Possible values: `prev` OR `next`. * @param int $caption Button caption. * @param array $form_data Form data and settings. */ private function display_page_button( $action, $caption, $form_data ) { $frontend_obj = wpforms()->obj( 'frontend' ); $current = $frontend_obj->pages['current']; if ( ! $this->has_page_button( $action, $caption ) ) { return; } printf( '', esc_attr( $action ), (int) $current, (int) $form_data['id'], esc_html( $caption ) ); if ( $action !== 'next' ) { return; } /** This action is documented in includes/class-frontend.php. */ do_action( 'wpforms_display_submit_after', $form_data, 'next' ); // phpcs:ignore WPForms.PHP.ValidateHooks.InvalidHookName } /** * Is a button visible for the page? * * @since 1.8.6 * * @param string $action Prev or next action. * @param string $caption Button caption. * * @return bool */ private function has_page_button( string $action, string $caption ): bool { $frontend_obj = wpforms()->obj( 'frontend' ); $current = $frontend_obj->pages['current']; $total = $frontend_obj->pages['total']; if ( empty( $caption ) ) { return false; } if ( $action === 'prev' && $current <= 1 ) { return false; } return ! ( $action === 'next' && $current >= $total ); } /** * Open page indicator container. * * @since 1.8.1 * * @param array $pagebreak Field data and settings. */ public function open_page_indicator_container( $pagebreak ) { $modern_attributes = ''; if ( wpforms_get_render_engine() === 'modern' ) { $modern_attributes = sprintf( ' role="progressbar" aria-valuenow="1" aria-valuemin="1" aria-valuemax="%d" tabindex="-1"', count( $pagebreak['pages'] ) ); } printf( '
', esc_attr( $pagebreak['indicator'] ), esc_attr( $pagebreak['indicator'] ), esc_attr( $pagebreak['color'] ), (int) $pagebreak['scroll'], $modern_attributes // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ); } /** * Modify javascript `wpforms_settings` properties on the front end. * * @since 1.8.1 * * @param array $strings Array `wpforms_settings` properties. * * @return array */ public function frontend_strings( $strings ) { $strings['indicatorStepsPattern'] = sprintf( /* translators: %1$s - current step in multi-page form, %2$s - total number of pages. */ esc_html__( 'Step %1$s of %2$s', 'wpforms' ), '{current}', '{total}' ); return $strings; } }