HEX
Server: LiteSpeed
System: Linux server315.web-hosting.com 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
User: globfdxw (6114)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: /home/globfdxw/public_html/wp-content/plugins/wpforms-pdf/src/Notifications/Fields/Pagebreak.php
<?php

namespace WPFormsPDF\Notifications\Fields;

/**
 * Class Pagebreak field.
 *
 * @since 1.0.0
 */
class Pagebreak {

	/**
	 * Class constructor.
	 *
	 * @since 1.0.0
	 *
	 * @return void
	 */
	public function __construct() {

		$this->hooks();
	}

	/**
	 * Register hooks.
	 *
	 * @since 1.0.0
	 *
	 * @return void
	 */
	public function hooks(): void {

		add_filter(
			'wpforms_pdf_notifications_fields_field_message_html_pagebreak',
			[ $this, 'field_row_html_value' ],
			100,
			7
		);
	}

	/**
	 * Get field message HTML markup.
	 *
	 * It includes the field label and value.
	 *
	 * @since 1.0.0
	 *
	 * @param string|mixed $field_markup Field HTML markup.
	 * @param array        $field        Field data.
	 * @param array        $form_data    Form data.
	 * @param array        $template     Template data.
	 *
	 * @return string
	 */
	public function field_row_html_value( $field_markup, array $field, array $form_data, array $template ): string {

		$field_markup = (string) $field_markup;

		$field['label']       = $field['title'] ?? '';
		$field['description'] = '';

		if ( empty( $field['label'] ) ) {
			return '';
		}

		return Divider::field_row_html_value_static( $field_markup, $field, $form_data, $template );
	}
}