: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
$args['class'] = ! empty( $args['class'] ) ? $args['class'] : '' . ' pum-postselect';
$this->objectselect_callback( $args, $value );
* Renders the rangeslider.
* @param array $args Arguments passed by the setting
public function rangeslider_callback( $args, $value = null ) {
$this->field_before( $args );
$value = isset( $args['std'] ) ? $args['std'] : '';
$this->field_label( $args );
value="<?php echo $value; ?>"
name="<?php echo esc_attr( $args['name'] ); ?>"
id="<?php echo esc_attr( $args['id'] ); ?>"
class="pum-range-manual popmake-range-manual"
step="<?php echo esc_attr( $args['step'] ); ?>"
min="<?php echo esc_attr( $args['min'] ); ?>"
max="<?php echo esc_attr( $args['max'] ); ?>"
if ( $args['required'] ) {
data-force-minmax="<?php echo esc_attr( $args['force_minmax'] ); ?>"
<span class="range-value-unit regular-text"><?php echo esc_html( $args['unit'] ); ?></span>
$this->field_description( $args );
// endregion Custom Fields (post_type, taxonomy, object, rangeslider)
// region Templ Non Fields
public function heading_templ_callback( $args ) {
$this->heading_callback( $args );
public function text_templ_callback( $args ) {
if ( 'text' !== $args['type'] ) {
$args['class'] .= ' pum-field-text';
$this->field_before( $args );
$this->field_label( $args );
<input type="<?php echo esc_attr( $args['type'] ); ?>" placeholder="<?php echo esc_attr( $args['placeholder'] ); ?>" class="<?php echo esc_attr( $args['size'] ); ?>-text" id="<?php echo esc_attr( $args['id'] ); ?>" name="<?php echo esc_attr( $args['name'] ); ?>" value="{{data.<?php echo $args['templ_name']; ?>}}" />
$this->field_description( $args );
* Renders password fields.
* @param array $args Arguments passed by the setting
public function password_templ_callback( $args ) {
$args['type'] = 'password';
$this->text_templ_callback( $args );
* @param array $args Arguments passed by the setting
public function email_templ_callback( $args ) {
$this->text_templ_callback( $args );
* @param array $args Arguments passed by the setting
public function search_templ_callback( $args ) {
$args['type'] = 'search';
$this->text_templ_callback( $args );
* @param array $args Arguments passed by the setting
public function url_templ_callback( $args ) {
$this->text_templ_callback( $args );
* Renders telelphone number fields.
* @param array $args Arguments passed by the setting
public function tel_templ_callback( $args ) {
$this->text_templ_callback( $args );
* @param array $args Arguments passed by the setting
public function number_templ_callback( $args ) {
$args['type'] = 'number';
$this->text_templ_callback( $args );
* @param array $args Arguments passed by the setting
public function range_templ_callback( $args ) {
$this->text_templ_callback( $args );
* @param array $args Arguments passed by the setting
public function hidden_templ_callback( $args ) {
$class = $this->field_classes( $args );
<input type="hidden" class="<?php echo esc_attr( $class ); ?>" id="<?php echo esc_attr( $args['id'] ); ?>" name="<?php echo esc_attr( $args['name'] ); ?>" value="{{data.<?php echo $args['templ_name']; ?>}}"/>
public function select_templ_callback( $args ) {
if ( $args['select2'] ) {
$args['class'] .= ' pum-field-select2';
if ( $args['multiple'] ) {
$args['class'] .= ' pum-field-select--multiple';
$args['name'] .= $args['as_array'] ? '[]' : '';
$this->field_before( $args );
$this->field_label( $args );
<select id="<?php echo esc_attr( $args['id'] ); ?>" name="<?php echo esc_attr( $args['name'] ); ?>" data-placeholder="<?php echo esc_attr( $args['placeholder'] ); ?>" data-allow-clear="true" <?php echo $multiple; ?>>
if ( ! empty( $args['options'] ) ) {
foreach ( $args['options'] as $label => $option ) {
<option value="<?php echo esc_attr( $option ); ?>" {{pumSelected(data.<?php echo esc_attr( $args['templ_name'] ); ?>, '<?php echo $option; ?>', true)}}>
<?php echo esc_html( $label ); ?>
$this->field_description( $args );
* Posttype Select Callback
* @param array $args Arguments passed by the setting
public function postselect_templ_callback( $args ) {
$args['object_type'] = 'post_type';
$args['object_key'] = $args['post_type'];
$args['class'] .= ' pum-postselect';
$this->objectselect_templ_callback( $args );
public function objectselect_templ_callback( $args ) {
if ( 'objectselect' !== $args['type'] ) {
$args['class'] .= ' pum-field-objectselect';
$args['class'] .= ' pum-field-select pum-field-select2';
if ( $args['multiple'] ) {
$args['class'] .= ' pum-field-select--multiple';
$args['name'] .= $args['as_array'] ? '[]' : '';
$this->field_before( $args );
$this->field_label( $args );
<# var templ_name = '<?php echo esc_attr( $args['templ_name'] ); ?>'; #>
<# if (typeof data[templ_name] === 'undefined') {
<select id="<?php echo esc_attr( $args['id'] ); ?>" name="<?php echo esc_attr( $args['name'] ); ?>" data-placeholder="<?php echo esc_attr( $args['placeholder'] ); ?>" data-allow-clear="true" <?php echo $multiple; ?> data-objecttype="<?php echo esc_attr( $args['object_type'] ); ?>" data-objectkey="<?php echo esc_attr( $args['object_key'] ); ?>">
if ( ! empty( $args['options'] ) ) {
foreach ( $args['options'] as $label => $option ) {
<option value="<?php echo esc_attr( $option ); ?>" {{pumSelected(data[templ_name], '<?php echo $option; ?>', true)}}>
<?php echo esc_html( $label ); ?>
$this->field_description( $args );
* @param array $args Arguments passed by the setting
public function taxonomyselect_templ_callback( $args ) {
$args['object_type'] = 'taxonomy';
$args['object_key'] = $args['taxonomy'];
$args['class'] .= ' pum-field-taxonomyselect';
$this->objectselect_templ_callback( $args );
public function checkbox_templ_callback( $args ) {
$this->field_before( $args );
$this->field_label( $args );
<# var checked = data.<?php echo esc_attr( $args['templ_name'] ); ?> !== undefined && data.<?php echo esc_attr( $args['templ_name'] ); ?> ? true : false; #>
<input type="checkbox" id="<?php echo esc_attr( $args['id'] ); ?>" name="<?php echo esc_attr( $args['name'] ); ?>" value="<?php echo esc_attr( $args['checkbox_val'] ); ?>" {{pumChecked(checked, true, true)}} />
$this->field_description( $args );
public function multicheck_templ_callback( $args ) {
$this->field_before( $args );
$this->field_label( $args );
$this->field_description( $args );
<# var checked = data.<?php echo esc_attr( $args['templ_name'] ); ?> !== undefined && data.<?php echo esc_attr( $args['templ_name'] ); ?> && typeof data.<?php echo esc_attr( $args['templ_name'] ); ?> === 'object' ? data.<?php echo esc_attr( $args['templ_name'] ); ?> : {}; #>
if ( ! empty( $args['options'] ) ) {
foreach ( $args['options'] as $option => $label ) {
<# if (checked.<?php echo esc_attr( $option ); ?> === undefined) {
checked.<?php echo esc_attr( $option ); ?> = false;
<input name="<?php echo esc_attr( $args['name'] ); ?>[<?php echo esc_attr( $option ); ?>]" id="<?php echo esc_attr( $args['id'] ); ?>_<?php echo esc_attr( $option ); ?>" type="checkbox" value="<?php echo esc_html( $option ); ?>" {{pumChecked(checked.<?php echo esc_attr( $option ); ?>, '<?php echo $option; ?>', true)}} />
<label for="<?php echo esc_attr( $args['id'] ); ?>_<?php echo esc_attr( $option ); ?>"><?php echo esc_html( $label ); ?></label><br/>
public function rangeslider_templ_callback( $args ) {
$value = '{{data.' . $args['templ_name'] . '}}';
$this->rangeslider_callback( $args, $value );
public function postselect_sanitize( $value = [], $args = [] ) {
return $this->objectselect_sanitize( $value, $args );
public function objectselect_sanitize( $value = [], $args = [] ) {
return wp_parse_id_list( $value );
public function taxonomyselect_sanitize( $value = [], $args = [] ) {
return $this->objectselect_sanitize( $value, $args );
* TODO: Finish adding the following field types for HTML & underscore.js
* @param array $args Arguments passed by the setting
* public function radio_callback( $args, $value ) {
* if ( ! empty( $args['options'] ) ) {
* foreach ( $args['options'] as $key => $option ) {
* $value = $this->get_option( $args['id'] );
* if ( $value == $key || ( ! $value && isset( $args['std'] ) && $args['std'] == $key ) ) {
* echo '<input name="<?php echo esc_attr( $args['name'] ); ?>"" id="<?php echo esc_attr( $args['id'] ); ?>[<?php echo esc_attr( $key ); ?>]" type="radio" value="<?php echo esc_attr( $key ); ?>" ' . checked( true, $checked, false ) . '/> ';
* echo '<label for="<?php echo esc_attr( $args['id'] ); ?>[<?php echo esc_attr( $key ); ?>]">' . $option . '</label><br/>';
* echo '<p class="pum-desc">' . $args['desc'] . '</p>';
* Renders color select fields.
* @param array $args Arguments passed by the setting
* public function color_select_callback( $args ) {
* $value = $this->get_option( $args['id'] );
* $value = isset( $args['std'] ) ? $args['std'] : '';
* $html = '<select id="<?php echo esc_attr( $args['id'] ); ?>" name="<?php echo esc_attr( $args['name'] ); ?>"/>';
* if ( ! empty( $args['options'] ) ) {
* foreach ( $args['options'] as $option => $color ) {
* $selected = selected( $option, $value, false );
* $html .= '<option value="' . $option . '" ' . $selected . '>' . $color['label'] . '</option>';
* $html .= '<label for="<?php echo esc_attr( $args['id'] ); ?>"> ' . $args['desc'] . '</label>';
* Renders rich editor fields.
* @param array $args Arguments passed by the setting
* @global $wp_version WordPress Version
* public function rich_editor_callback( $args ) {
* $value = $this->get_option( $args['id'] );
* $value = isset( $args['std'] ) ? $args['std'] : '';
* $rows = isset( $args['size'] ) ? $args['size'] : 20;
* if ( $wp_version >= 3.3 && function_exists( 'wp_editor' ) ) {
* wp_editor( stripslashes( $value ), $this->options_key . '_' . $args['id'], array(
* 'textarea_name' => '' . $this->options_key . '[' . $args['id'] . ']',
* 'textarea_rows' => $rows
* $html = ob_get_clean();
* $html = '<textarea class="large-text" rows="10" id="<?php echo esc_attr( $args['id'] ); ?>" name="<?php echo esc_attr( $args['name'] ); ?>">' . esc_textarea( stripslashes( $value ) ) . '</textarea>';
* $html .= '<br/><label for="<?php echo esc_attr( $args['id'] ); ?>"> ' . $args['desc'] . '</label>';
* @param array $args Arguments passed by the setting
* public function upload_callback( $args ) {
* $value = $this->get_option( $args['id'] );
* $value = isset( $args['std'] ) ? $args['std'] : '';
* $size = ( isset( $args['size'] ) && ! is_null( $args['size'] ) ) ? $args['size'] : 'regular';
* $html = '<input type="text" class="' . $size . '-text" id="<?php echo esc_attr( $args['id'] ); ?>" name="<?php echo esc_attr( $args['name'] ); ?>" value="' . echo esc_attr( stripslashes( $value ) ) . '"/>';
* $html .= '<span> <input type="button" class="' . $this->options_key . '_upload_button button-secondary" value="' . __( 'Upload File' ) . '"/></span>';
* $html .= '<label for="<?php echo esc_attr( $args['id'] ); ?>"> ' . $args['desc'] . '</label>';
* Renders color picker fields.
* @param array $args Arguments passed by the setting
* public function color_callback( $args ) {