HEX
Server: Apache/2.4.65 (Debian)
System: Linux web6 5.10.0-36-amd64 #1 SMP Debian 5.10.244-1 (2025-09-29) x86_64
User: innocamp (1028)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: //home/plan4ev/public_html/wp-content/plugins/caldera-forms/classes/sync/summary.php
<?php

/**
 * Magic tag sync implementation for summary fields
 *
 * @package Caldera_Forms
 * @author    Josh Pollock <Josh@CalderaWP.com>
 * @license   GPL-2.0+
 * @link
 * @copyright 2016 CalderaWP LLC
 */
class Caldera_Forms_Sync_Summary extends Caldera_Forms_Sync_HTML {


	/**
	 * @inheritdoc
	 */
	protected function initial_set_default() {
		$this->default = $this->create_summary();
	}

	/**
	 * Create summary content
	 *
	 * @since 1.5.0
	 *
	 * @return string
	 */
	protected function create_summary(){

		/**
		 * Element type to wrap Caldera Forms summary fields in
		 *
		 * @since 1.5.0
		 *
		 * @param string $type Element type ONLY. For example 'div' not '<div>'.
		 * @param array $field Field config
		 * @param array $form Form config
		 */
		$summary_wrap = apply_filters( 'caldera_forms_summary_field_list_wrap', 'ul', $this->field, $this->form );

		/**
		 * Sprintf pattern for summary field items
		 *
		 * MUST have 2 %s
		 *
		 * @since 1.5.0
		 *
		 * @param string $summary_pattern The sprintf pattern for each item. With 2 %s -- no more, no less or errors will happen
		 * @param array $field Field config
		 * @param array $form Form config
		 */
		$summary_pattern = apply_filters( 'caldera_forms_summary_field_pattern', '<li><span class="caldera-forms-summary-label">%s</span> <span class="caldera-forms-summary-value">%s</span></li>', $this->field, $this->form );

		$summary = '<' . $summary_wrap .' >';
		foreach ( Caldera_Forms_Forms::get_fields( $this->form, true ) as $_field ){
			if( $_field[ 'ID' ] == $this->field[ 'ID' ] || true === $this->dont_sync( Caldera_Forms_Field_Util::get_type( $_field, $this->form ) ) )  {
				continue;
			}

			$magic_tag = '%' . $_field[ 'slug' ] . '%';
			$summary .= sprintf( $summary_pattern, esc_html( $_field[ 'label' ] ), $magic_tag );
		}

		$summary .= '</' . $summary_wrap . '>';
		return $summary;
	}

	/**
	 * Check if type of field is a type NOT to sync to
	 *
	 * @since 1.5.0
	 *
	 * @param string $type Field type
	 *
	 * @return bool True if syncing is disallowed
	 */
	protected function dont_sync( $type ){
		if( in_array( $type, array(
			'button',
			'summary',
			'html',
			'section_break'
		))){
			return true;
		}

		return false;
	}
}