| Server IP : 39.106.62.82 / Your IP : 216.73.217.128 Web Server : nginx/1.14.1 System : Linux iz2ze1m0zmp2dk5c3j5ap5z 3.10.0-1127.19.1.el7.x86_64 #1 SMP Tue Aug 25 17:23:54 UTC 2020 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 : ON | Sudo : ON | Pkexec : ON Directory : /webdata/gohomesh.com/wp-content/plugins/pods/classes/fields/ |
Upload File : |
<?php
/**
* @package Pods\Fields
*/
class PodsField_Heading extends PodsField {
/**
* {@inheritdoc}
*/
public static $group = 'Layout Elements';
/**
* {@inheritdoc}
*/
public static $type = 'heading';
/**
* {@inheritdoc}
*/
public static $label = 'Heading';
/**
* {@inheritdoc}
*/
public static $prepare = '%s';
/**
* {@inheritdoc}
*/
public function setup() {
static::$group = __( 'Layout Elements', 'pods' );
static::$label = __( 'Heading', 'pods' );
}
/**
* {@inheritdoc}
*/
public function options() {
return [
static::$type . '_tag' => [
'label' => __( 'Heading HTML Tag', 'pods' ),
'type' => 'text',
'default' => '',
'description' => __( 'Leave this empty to use the default heading tag for the form context the heading appears in.', 'pods' ),
'help' => __( 'This is the heading HTML tag to use for the heading text. Example "h2" will output your heading as <code><h2>Heading Text</h2></code>', 'pods' ),
],
'output_options' => [
'label' => __( 'Output Options', 'pods' ),
'type' => 'boolean_group',
'boolean_group' => [
static::$type . '_allow_html' => [
'label' => __( 'Allow HTML', 'pods' ),
'default' => 1,
'type' => 'boolean',
'dependency' => true,
],
static::$type . '_wptexturize' => [
'label' => __( 'Enable wptexturize', 'pods' ),
'default' => 1,
'type' => 'boolean',
'help' => [
__( 'Transforms less-beautiful text characters into stylized equivalents.', 'pods' ),
'http://codex.wordpress.org/Function_Reference/wptexturize',
],
],
static::$type . '_allow_shortcode' => [
'label' => __( 'Allow Shortcodes', 'pods' ),
'default' => 0,
'type' => 'boolean',
'dependency' => true,
'help' => [
__( 'Embed [shortcodes] that help transform your static content into dynamic content.', 'pods' ),
'http://codex.wordpress.org/Shortcode_API',
],
],
],
],
];
}
/**
* {@inheritdoc}
*/
public function schema( $options = null ) {
return false;
}
/**
* {@inheritdoc}
*/
public function input( $name, $value = null, $options = null, $pod = null, $id = null ) {
$options = ( is_array( $options ) || is_object( $options ) ) ? $options : (array) $options;
// @codingStandardsIgnoreLine
echo $this->display( $value, $name, $options, $pod, $id );
}
/**
* {@inheritdoc}
*/
public function display( $value = null, $name = null, $options = null, $pod = null, $id = null ) {
// Support passing html_content into the options for custom HTML option layouts.
if ( empty( $value ) && ! empty( $options[ static::$type . '_content' ] ) ) {
$value = $options[ static::$type . '_content' ];
}
$value = $this->strip_html( $value, $options );
$value = $this->strip_shortcodes( $value, $options );
$value = $this->trim_whitespace( $value, $options );
if ( 1 === (int) pods_v( static::$type . '_wptexturize', $options, 1 ) ) {
$value = wptexturize( $value );
}
if ( 1 === (int) pods_v( static::$type . '_allow_shortcode', $options, 0 ) ) {
$value = do_shortcode( $value );
}
return $value;
}
/**
* {@inheritdoc}
*/
public function ui( $id, $value, $name = null, $options = null, $fields = null, $pod = null ) {
$value = $this->strip_html( $value, $options );
$value = $this->strip_shortcodes( $value, $options );
$value = $this->trim_whitespace( $value, $options );
return wp_trim_words( $value );
}
}