merge_attributes() public static method

Merge attributes and handle classes
Since: 2.0
public static merge_attributes ( $attributes, $name = null, $type = null, $options = null, $classes = '' )
<?php

wp_enqueue_script('pods-codemirror');
wp_enqueue_style('pods-codemirror');
wp_enqueue_script('pods-codemirror-loadmode');
$type = 'textarea';
$attributes = array();
$attributes['tabindex'] = 2;
$attributes = PodsForm::merge_attributes($attributes, $name, $form_field_type, $options, 'pods-ui-field-codemirror');
?>
<div class="code-toolbar"><!-- Placeholder --></div>
<textarea<?php 
PodsForm::attributes($attributes, $name, $form_field_type, $options);
?>
><?php 
echo esc_textarea($value);
?>
</textarea>
<div class="code-footer"><!-- Placeholder --></div>

<script>
    var $textarea_<?php 
echo esc_js(pods_js_name($attributes['id']));
?>
, codemirror_<?php 
echo esc_js(pods_js_name($attributes['id']));
?>
;

    jQuery( function ( $ ) {
        $textarea_<?php 
<?php

$type = 'textarea';
$attributes = array();
$attributes['tabindex'] = 2;
$attributes = PodsForm::merge_attributes($attributes, $name, $form_field_type, $options);
if (pods_var('readonly', $options, false)) {
    $attributes['readonly'] = 'READONLY';
    $attributes['class'] .= ' pods-form-ui-read-only';
}
?>
    <textarea<?php 
PodsForm::attributes($attributes, $name, $form_field_type, $options);
?>
><?php 
echo esc_textarea($value);
?>
</textarea>
<?php 
PodsForm::regex($form_field_type, $options);
Beispiel #3
0
<?php

$settings = array();
$settings['textarea_name'] = $name;
$settings['media_buttons'] = false;
if (!(defined('PODS_DISABLE_FILE_UPLOAD') && true === PODS_DISABLE_FILE_UPLOAD) && !(defined('PODS_UPLOAD_REQUIRE_LOGIN') && is_bool(PODS_UPLOAD_REQUIRE_LOGIN) && true === PODS_UPLOAD_REQUIRE_LOGIN && !is_user_logged_in()) && !(defined('PODS_UPLOAD_REQUIRE_LOGIN') && !is_bool(PODS_UPLOAD_REQUIRE_LOGIN) && (!is_user_logged_in() || !current_user_can(PODS_UPLOAD_REQUIRE_LOGIN)))) {
    $settings['media_buttons'] = (bool) pods_var('wysiwyg_media_buttons', $options, true);
}
if (isset($options['settings'])) {
    $settings = array_merge($settings, $options['settings']);
}
$attributes = array();
$attributes = PodsForm::merge_attributes($attributes, $name, $form_field_type, $options, 'pods-ui-field-tinymce');
$class_attributes = array('class' => $attributes['class']);
?>
<div<?php 
PodsForm::attributes($class_attributes, $name, $form_field_type, $options);
?>
>
    <?php 
wp_editor($value, $attributes['id'], $settings);
?>
</div>