Server IP : 172.67.216.182 / Your IP : 162.158.88.59 Web Server : Apache System : Linux krdc-ubuntu-s-2vcpu-4gb-amd-blr1-01.localdomain 5.15.0-142-generic #152-Ubuntu SMP Mon May 19 10:54:31 UTC 2025 x86_64 User : www ( 1000) PHP Version : 7.4.33 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,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_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /www/wwwroot/coircraft.com/wp-content/plugins/caldera-forms/classes/magic/ |
Upload File : |
<?php /** * Abstract class that all magic tag parsing classes should extend * * @package Caldera_Forms * @author Josh Pollock <[email protected]> * @license GPL-2.0+ * @link * @copyright 2016 CalderaWP LLC */ abstract class Caldera_Forms_Magic_Parser { /** * Form config * * @since 1.4.6 * * @var array */ protected $form; /** * The data to use for parsing * * @since 1.4.6 * * @var array */ protected $data; /** * Rendered magic tag * * @since 1.4.6 * * @var string|null */ protected $tag; /** * Holds instance of credit card hasher class * * @since 1.5.0.7 * * @var Caldera_Forms_Field_Credit */ protected $credit_card_hasher; /** * Caldera_Forms_Magic_Parser constructor. * * @since 1.4.6 * * @param array $form Form config * @param array|null $data Optional (depending on parent) data to use to parse */ public function __construct( array $form, array $data = null ) { $this->form = $form; /** * Filter data for use by magic parsers extending the Caldera_Forms_Magic_Parser class sunch as summary * * @since 1.5.2 * * @param array $data Data to use * @param array $form Form config */ $this->data = apply_filters( 'caldera_forms_magic_parser_data', $data, $this->form ); } /** * Get rendered magic tag * * @since 1.4.6 * * @return null|string */ public function get_tag(){ if( null == $this->tag ){ $this->parse(); } return $this->tag; } /** * Parse tag * * Set tag property * * @since 1.4.6 */ protected function parse(){ //SHOULD OVVERIDE IN PARENT CLASS //Would have declared abstract, but 5.2... $this->tag = ''; } /** * Getter for field data * * @since 1.5.0.7 * * @param string $field_id Field ID to get * * @return mixed|null */ protected function get_field_value( $field_id ){ if( ! is_array( $this->data ) ){ $this->data = Caldera_Forms::get_submission_data( $this->form ); } $value = null; if( isset( $this->data[ $field_id ] ) ){ $value = $this->data[ $field_id ]; } //Add filter? return $value; } /** * Get credit card hasher class * * @since 1.5.0.7 * * @return Caldera_Forms_Field_Credit */ protected function get_credit_card_hasher(){ if( null === $this->credit_card_hasher ){ $this->credit_card_hasher = new Caldera_Forms_Field_Credit; } return $this->credit_card_hasher; } }