Server IP : 104.21.38.3 / Your IP : 172.68.164.75 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/render/ |
Upload File : |
<?php /** * System for printing extra scripts, etc in footer, per form * * Should be used through Caldera_Forms_Render_Util::add_inline_data() which acts as factory, container for these objects, by form ID and a way to add to tracked objects. * * @package Caldera_Forms * @author Josh Pollock <[email protected]> * @license GPL-2.0+ * @link * @copyright 2016 CalderaWP LLC */ class Caldera_Forms_Render_Footer { /** * Form config * * @since 1.5.0 * * @var array */ protected $form; /** * * @since 1.5.0 * * @var array */ protected $data; /** * Tracks if output has occurred yet. * * @since 1.5.0 * * @var bool */ protected $printed; /** * Caldera_Forms_Render_Footer constructor. * * @since 1.5.0 * * @param array $form */ public function __construct( array $form ) { $this->form = $form; $this->data = array(); $this->printed = false; if ( ! is_admin() ) { add_action( 'wp_footer', array( $this, 'print_data' ), 1000 ); } else { add_action( 'admin_footer', array( $this, 'print_data' ), 1000 ); } } /** * Remove hooks for this object * * @since 1.5.0 */ public function remove_hooks(){ if ( ! is_admin() ) { remove_action( 'wp_footer', array( $this, 'print_data' ), 1000 ); } else { remove_action( 'admin_footer', array( $this, 'print_data' ), 1000 ); } } /** * Get the data to print in footer as a string * * @since 1.5.6 * * @return string */ public function get_data_as_string( ){ if( ! empty( $this->data ) ) { return implode( "\n", $this->data ); } return ''; } /** * Add a string to be printed * * @since 1.5.0 * * @param string $data Content to print * * @return bool True if added, false if not */ public function add_data( $data ){ if( false == $this->printed && is_string( $data ) ){ $this->data[] = $data; return true; } return false; } /** * Print data * * @uses "wp_footer" or "admin_footer" action * * @since 1.5.0 */ public function print_data(){ echo $this->get_data_as_string(); $this->printed = true; } }