当前位置: 首页>>代码示例>>PHP>>正文


PHP wpb_removeNotExistingImgIDs函数代码示例

本文整理汇总了PHP中wpb_removeNotExistingImgIDs函数的典型用法代码示例。如果您正苦于以下问题:PHP wpb_removeNotExistingImgIDs函数的具体用法?PHP wpb_removeNotExistingImgIDs怎么用?PHP wpb_removeNotExistingImgIDs使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了wpb_removeNotExistingImgIDs函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: vc_attach_images_form_field

/**
 * Attach images shortcode attribute type generator.
 *
 * @param $settings
 * @param $value
 *
 * @since 4.4
 *
 * @param $tag
 * @param bool $single
 *
 * @return string - html string.
 */
function vc_attach_images_form_field($settings, $value, $tag, $single = false)
{
    $output = '';
    $param_value = wpb_removeNotExistingImgIDs($value);
    $output .= '<input type="hidden" class="wpb_vc_param_value gallery_widget_attached_images_ids ' . $settings['param_name'] . ' ' . $settings['type'] . '" name="' . $settings['param_name'] . '" value="' . $value . '"/>';
    $output .= '<div class="gallery_widget_attached_images">';
    $output .= '<ul class="gallery_widget_attached_images_list">';
    $output .= '' !== $param_value ? fieldAttachedImages(explode(',', $value)) : '';
    $output .= '</ul>';
    $output .= '</div>';
    $output .= '<div class="gallery_widget_site_images">';
    $output .= '</div>';
    if (true === $single) {
        $output .= '<a class="gallery_widget_add_images" href="#" use-single="true" title="' . __('Add image', 'js_composer') . '">' . __('Add image', 'js_composer') . '</a>';
        //class: button
    } else {
        $output .= '<a class="gallery_widget_add_images" href="#" title="' . __('Add images', 'js_composer') . '">' . __('Add images', 'js_composer') . '</a>';
        //class: button
    }
    return $output;
}
开发者ID:severnrescue,项目名称:web,代码行数:34,代码来源:default_params.php

示例2: singleParamEditForm

 protected function singleParamEditForm($param, $param_value)
 {
     $param_line = '';
     // Textfield - input
     if ($param['type'] == 'textfield') {
         $value = __($param_value, "js_composer");
         $value = htmlspecialchars($value);
         //$value = $param_value;
         $param_line .= '<input name="' . $param['param_name'] . '" class="wpb_vc_param_value wpb-textinput ' . $param['param_name'] . ' ' . $param['type'] . '" type="text" value="' . $value . '"/>';
     } else {
         if ($param['type'] == 'dropdown') {
             $css_option = vc_get_dropdown_option($param, $param_value);
             $param_line .= '<select name="' . $param['param_name'] . '" class="wpb_vc_param_value wpb-input wpb-select ' . $param['param_name'] . ' ' . $param['type'] . ' ' . $css_option . '" data-option="' . $css_option . '">';
             foreach ($param['value'] as $text_val => $val) {
                 if (is_numeric($text_val) && (is_string($val) || is_numeric($val))) {
                     $text_val = $val;
                 }
                 $text_val = __($text_val, "js_composer");
                 //$val = strtolower(str_replace(array(" "), array("_"), $val));
                 //$val = strtolower(str_replace(array(" "), array("_"), $val)); //issue #464 github
                 $selected = '';
                 if ($param_value !== '' && (string) $val === (string) $param_value) {
                     $selected = ' selected="selected"';
                 }
                 $param_line .= '<option class="' . $val . '" value="' . $val . '"' . $selected . '>' . htmlspecialchars($text_val) . '</option>';
             }
             $param_line .= '</select>';
         } else {
             if ($param['type'] == 'textarea_html') {
                 if ($this->html_editor_already_is_used !== false) {
                     $param_value = __($param_value, "js_composer");
                     $param_line .= '<textarea name="' . $param['param_name'] . '" class="wpb_vc_param_value wpb-textarea ' . $param['param_name'] . ' textarea">' . $param_value . '</textarea>';
                     $param_line .= '<div class="updated"><p>' . __('Field type is changed from `textarea_html` to `textarea`, because it is already used by `' . $this->html_editor_already_is_used . '` field. Textarea_html field\'s type can be used only once per shortcode.', 'js_composer') . '</p></div>';
                 } else {
                     $this->html_editor_already_is_used = $param['param_name'];
                     $param_line .= do_shortcode_param_settings_field('textarea_html', $param, $param_value);
                 }
                 // $param_line .= $this->getTinyHtmlTextArea($param, $param_value);
             } else {
                 if ($param['type'] == 'checkbox') {
                     // param_line .= '<input class="wpb_vc_param_value wpb-checkboxes" type="hidden" value="" name="'.$param['param_name'].'"/>';
                     $current_value = explode(",", $param_value);
                     $values = is_array($param['value']) ? $param['value'] : array();
                     foreach ($values as $label => $v) {
                         $checked = in_array($v, $current_value) ? ' checked="checked"' : '';
                         $param_line .= ' <input id="' . $param['param_name'] . '-' . $v . '" value="' . $v . '" class="wpb_vc_param_value ' . $param['param_name'] . ' ' . $param['type'] . '" type="checkbox" name="' . $param['param_name'] . '"' . $checked . '> ' . __($label, "js_composer");
                     }
                 } else {
                     if ($param['type'] == 'posttypes') {
                         // $param_line .= '<input class="wpb_vc_param_value wpb-checkboxes" type="hidden" value="" name="'.$param['param_name'].'"/>';
                         $args = array('public' => true);
                         $post_types = get_post_types($args);
                         foreach ($post_types as $post_type) {
                             $checked = "";
                             if ($post_type != 'attachment') {
                                 if (in_array($post_type, explode(",", $param_value))) {
                                     $checked = ' checked="checked"';
                                 }
                                 $param_line .= ' <input id="' . $param['param_name'] . '-' . $post_type . '" value="' . $post_type . '" class="wpb_vc_param_value ' . $param['param_name'] . ' ' . $param['type'] . '" type="checkbox" name="' . $param['param_name'] . '"' . $checked . '> ' . $post_type;
                             }
                         }
                     } else {
                         if ($param['type'] == 'taxonomies' || $param['type'] == 'taxomonies') {
                             // $param_line .= '<input class="wpb_vc_param_value wpb-checkboxes" type="hidden" value="" name=""/>';
                             $post_types = get_post_types(array('public' => false, 'name' => 'attachment'), 'names', 'NOT');
                             foreach ($post_types as $type) {
                                 $taxonomies = get_object_taxonomies($type, '');
                                 foreach ($taxonomies as $tax) {
                                     $checked = "";
                                     if (in_array($tax->name, explode(",", $param_value))) {
                                         $checked = ' checked="checked"';
                                     }
                                     $param_line .= ' <label data-post-type="' . $type . '"><input id="' . $param['param_name'] . '-' . $tax->name . '" value="' . $tax->name . '" data-post-type="' . $type . '" class="wpb_vc_param_value ' . $param['param_name'] . ' ' . $param['type'] . '" type="checkbox" name="' . $param['param_name'] . '"' . $checked . '> ' . $tax->label . '</label>';
                                 }
                             }
                         } else {
                             if ($param['type'] == 'exploded_textarea') {
                                 $param_value = str_replace(",", "\n", $param_value);
                                 $param_line .= '<textarea name="' . $param['param_name'] . '" class="wpb_vc_param_value wpb-textarea ' . $param['param_name'] . ' ' . $param['type'] . '">' . $param_value . '</textarea>';
                             } else {
                                 if ($param['type'] == 'textarea_raw_html') {
                                     // $param_value = __($param_value, "js_composer");
                                     $param_line .= '<textarea name="' . $param['param_name'] . '" class="wpb_vc_param_value wpb-textarea_raw_html ' . $param['param_name'] . ' ' . $param['type'] . '" rows="16">' . htmlentities(rawurldecode(base64_decode($param_value)), ENT_COMPAT, 'UTF-8') . '</textarea>';
                                 } else {
                                     if ($param['type'] == 'textarea_safe') {
                                         // $param_value = __($param_value, "js_composer");
                                         $param_line .= '<textarea name="' . $param['param_name'] . '" class="wpb_vc_param_value wpb-textarea_raw_html ' . $param['param_name'] . ' ' . $param['type'] . '">' . vc_value_from_safe($param_value, true) . '</textarea>';
                                     } else {
                                         if ($param['type'] == 'textarea') {
                                             $param_value = __($param_value, "js_composer");
                                             $param_line .= '<textarea name="' . $param['param_name'] . '" class="wpb_vc_param_value wpb-textarea ' . $param['param_name'] . ' ' . $param['type'] . '">' . $param_value . '</textarea>';
                                         } else {
                                             if ($param['type'] == 'attach_images') {
                                                 // TODO: More native way
                                                 $param_value = wpb_removeNotExistingImgIDs($param_value);
                                                 $param_line .= '<input type="hidden" class="wpb_vc_param_value gallery_widget_attached_images_ids ' . $param['param_name'] . ' ' . $param['type'] . '" name="' . $param['param_name'] . '" value="' . $param_value . '"/>';
                                                 //$param_line .= '<a class="button gallery_widget_add_images" href="#" title="'.__('Add images', "js_composer").'">'.__('Add images', "js_composer").'</a>';
                                                 $param_line .= '<div class="gallery_widget_attached_images">';
                                                 $param_line .= '<ul class="gallery_widget_attached_images_list">';
                                                 $param_line .= $param_value != '' ? fieldAttachedImages(explode(",", $param_value)) : '';
//.........这里部分代码省略.........
开发者ID:epiii,项目名称:aros,代码行数:101,代码来源:shortcodes.php

示例3: singleParamEditForm


//.........这里部分代码省略.........
                                     }
                                     $param_line .= ' <input id="' . $param['param_name'] . '-' . $post_type . '" value="' . $post_type . '" class="' . $param['param_name'] . ' ' . $param['type'] . '" type="checkbox" name="' . $param['param_name'] . '"' . $checked . '> ' . $post_type;
                                 }
                             }
                         } else {
                             if ($param['type'] == 'taxonomies' || $param['type'] == 'taxomonies') {
                                 $param_line .= '<input class="wpb_vc_param_value wpb-checkboxes" type="hidden" value="" name=""/>';
                                 $post_types = get_post_types(array('public' => false, 'name' => 'attachment'), 'names', 'NOT');
                                 foreach ($post_types as $type) {
                                     $taxonomies = get_object_taxonomies($type, '');
                                     foreach ($taxonomies as $tax) {
                                         $checked = "";
                                         if (in_array($tax->name, explode(",", $param_value))) {
                                             $checked = ' checked="checked"';
                                         }
                                         $param_line .= ' <label data-post-type="' . $type . '"><input id="' . $param['param_name'] . '-' . $tax->name . '" value="' . $tax->name . '" data-post-type="' . $type . '" class="' . $param['param_name'] . ' ' . $param['type'] . '" type="checkbox" name="' . $param['param_name'] . '"' . $checked . '> ' . $tax->label . '</label>';
                                     }
                                 }
                             } else {
                                 if ($param['type'] == 'exploded_textarea') {
                                     $param_value = str_replace(",", "\n", $param_value);
                                     $param_line .= '<div class="content"><textarea name="' . $param['param_name'] . '" class="textarea wpb_vc_param_value wpb-textarea ' . $param['param_name'] . ' ' . $param['type'] . '">' . $param_value . '</textarea></div>';
                                 } else {
                                     if ($param['type'] == 'textarea_raw_html') {
                                         // $param_value = __($param_value, "js_composer");
                                         $param_line .= '<div class="content"><textarea name="' . $param['param_name'] . '" class="textarea wpb_vc_param_value wpb-textarea_raw_html ' . $param['param_name'] . ' ' . $param['type'] . '" rows="16">' . htmlentities(rawurldecode(base64_decode($param_value)), ENT_COMPAT, 'UTF-8') . '</textarea></div>';
                                     } else {
                                         if ($param['type'] == 'textarea') {
                                             $param_value = __($param_value, "js_composer");
                                             $param_line .= '<div class="content"><textarea name="' . $param['param_name'] . '" class="textarea wpb_vc_param_value wpb-textarea ' . $param['param_name'] . ' ' . $param['type'] . '">' . $param_value . '</textarea></div>';
                                         } else {
                                             if ($param['type'] == 'attach_images') {
                                                 // TODO: More native way
                                                 $param_value = wpb_removeNotExistingImgIDs($param_value);
                                                 $param_line .= '<input type="hidden" class="wpb_vc_param_value gallery_widget_attached_images_ids ' . $param['param_name'] . ' ' . $param['type'] . '" name="' . $param['param_name'] . '" value="' . $param_value . '"/>';
                                                 //$param_line .= '<a class="button gallery_widget_add_images" href="#" title="'.__('Add images', "js_composer").'">'.__('Add images', "js_composer").'</a>';
                                                 $param_line .= '<div class="gallery_widget_attached_images">';
                                                 $param_line .= '<ul class="gallery_widget_attached_images_list">';
                                                 $param_line .= $param_value != '' ? fieldAttachedImages(explode(",", $param_value)) : '';
                                                 $param_line .= '</ul>';
                                                 $param_line .= '</div>';
                                                 $param_line .= '<div class="gallery_widget_site_images">';
                                                 // $param_line .= siteAttachedImages(explode(",", $param_value));
                                                 $param_line .= '</div>';
                                                 $param_line .= '<a class="gallery_widget_add_images" href="#" title="' . __('Add images', "js_composer") . '">' . __('Add images', "js_composer") . '</a>';
                                                 //class: button
                                                 //$param_line .= '<div class="wpb_clear"></div>';
                                             } else {
                                                 if ($param['type'] == 'attach_image') {
                                                     $param_value = wpb_removeNotExistingImgIDs(preg_replace('/[^\\d]/', '', $param_value));
                                                     $param_line .= '<input type="hidden" class="wpb_vc_param_value gallery_widget_attached_images_ids ' . $param['param_name'] . ' ' . $param['type'] . '" name="' . $param['param_name'] . '" value="' . $param_value . '"/>';
                                                     //$param_line .= '<a class="button gallery_widget_add_images" href="#" use-single="true" title="'.__('Add image', "js_composer").'">'.__('Add image', "js_composer").'</a>';
                                                     $param_line .= '<div class="gallery_widget_attached_images">';
                                                     $param_line .= '<ul class="gallery_widget_attached_images_list">';
                                                     $param_line .= $param_value != '' ? fieldAttachedImages(explode(",", $param_value)) : '';
                                                     $param_line .= '</ul>';
                                                     $param_line .= '</div>';
                                                     $param_line .= '<div class="gallery_widget_site_images">';
                                                     // $param_line .= siteAttachedImages(explode(",", $param_value));
                                                     $param_line .= '</div>';
                                                     $param_line .= '<a class="gallery_widget_add_images" href="#" use-single="true" title="' . __('Add image', "js_composer") . '">' . __('Add image', "js_composer") . '</a>';
                                                     //class: button
                                                     //$param_line .= '<div class="wpb_clear"></div>';
                                                 } else {
                                                     if ($param['type'] == 'widgetised_sidebars') {
                                                         $wpb_sidebar_ids = array();
开发者ID:Beutiste,项目名称:wordpress,代码行数:67,代码来源:shortcodes.php

示例4: singleParamEditForm

 protected function singleParamEditForm($param, $param_value)
 {
     $param_line = '';
     // Textfield - input
     if ($param['type'] == 'textfield') {
         $value = __($param_value, "js_composer");
         $value = $param_value;
         $param_line .= '<input name="' . $param['param_name'] . '" class="wpb_vc_param_value wpb-textinput ' . $param['param_name'] . ' ' . $param['type'] . '" type="text" value="' . $value . '" />';
     } else {
         if ($param['type'] == 'dropdown') {
             $param_line .= '<select name="' . $param['param_name'] . '" class="wpb_vc_param_value wpb-input wpb-select ' . $param['param_name'] . ' ' . $param['type'] . '">';
             foreach ($param['value'] as $text_val => $val) {
                 if (is_numeric($text_val) && is_string($val) || is_numeric($text_val) && is_numeric($val)) {
                     $text_val = $val;
                 }
                 $text_val = __($text_val, "js_composer");
                 $val = strtolower(str_replace(array(" "), array("_"), $val));
                 $selected = '';
                 if ($val == $param_value) {
                     $selected = ' selected="selected"';
                 }
                 $param_line .= '<option class="' . $val . '" value="' . $val . '"' . $selected . '>' . $text_val . '</option>';
             }
             $param_line .= '</select>';
         } else {
             if ($param['type'] == 'select-multiple') {
                 $param_line .= '<select name="' . $param['param_name'] . '" class="wpb_vc_param_value ' . $param['param_name'] . ' ' . $param['type'] . '" type="hidden" value="" name="" multiple>';
                 $selected_values = explode(",", $param_value);
                 foreach ($param['value'] as $text_val => $val) {
                     if (is_numeric($text_val) && is_string($val) || is_numeric($text_val) && is_numeric($val)) {
                         $text_val = $val;
                     }
                     $text_val = __($text_val, "swift_page_builder");
                     $selected = '';
                     if (in_array($val, $selected_values)) {
                         $selected = ' selected="selected"';
                     }
                     $param_line .= '<option id="' . $text_val . '" value="' . $val . '"' . $selected . '>' . $text_val . '</option>';
                 }
                 $param_line .= '</select>';
             } else {
                 if ($param['type'] == 'textarea_html') {
                     $param_line .= $this->getTinyHtmlTextArea($param, $param_value);
                 } else {
                     if ($param['type'] == 'posttypes') {
                         $param_line .= '<input class="wpb_vc_param_value wpb-checkboxes" type="hidden" value="" name="" />';
                         $args = array('public' => true);
                         $post_types = get_post_types($args);
                         foreach ($post_types as $post_type) {
                             $checked = "";
                             if ($post_type != 'attachment') {
                                 if (in_array($post_type, explode(",", $param_value))) {
                                     $checked = ' checked="checked"';
                                 }
                                 $param_line .= ' <input id="' . $post_type . '" class="' . $param['param_name'] . ' ' . $param['type'] . '" type="checkbox" name="' . $param['param_name'] . '"' . $checked . '> ' . $post_type;
                             }
                         }
                     } else {
                         if ($param['type'] == 'exploded_textarea') {
                             $param_value = str_replace(",", "\n", $param_value);
                             $param_line .= '<textarea name="' . $param['param_name'] . '" class="wpb_vc_param_value wpb-textarea ' . $param['param_name'] . ' ' . $param['type'] . '">' . $param_value . '</textarea>';
                         } else {
                             if ($param['type'] == 'textarea_raw_html') {
                                 // $param_value = __($param_value, "js_composer");
                                 $param_line .= '<textarea name="' . $param['param_name'] . '" class="wpb_vc_param_value wpb-textarea_raw_html ' . $param['param_name'] . ' ' . $param['type'] . '" rows="16">' . htmlentities(rawurldecode(base64_decode($param_value)), ENT_COMPAT, 'UTF-8') . '</textarea>';
                             } else {
                                 if ($param['type'] == 'textarea') {
                                     $param_value = __($param_value, "js_composer");
                                     $param_line .= '<textarea name="' . $param['param_name'] . '" class="wpb_vc_param_value wpb-textarea ' . $param['param_name'] . ' ' . $param['type'] . '">' . $param_value . '</textarea>';
                                 } else {
                                     if ($param['type'] == 'attach_images') {
                                         // TODO: More native way
                                         $param_value = wpb_removeNotExistingImgIDs($param_value);
                                         $param_line .= '<input type="hidden" class="wpb_vc_param_value gallery_widget_attached_images_ids ' . $param['param_name'] . ' ' . $param['type'] . '" name="' . $param['param_name'] . '" value="' . $param_value . '" />';
                                         $param_line .= '<a class="button gallery_widget_add_images" href="#" title="' . __('Add images', "js_composer") . '">' . __('Add images', "js_composer") . '</a>';
                                         $param_line .= '<div class="gallery_widget_attached_images">';
                                         $param_line .= '<ul class="gallery_widget_attached_images_list">';
                                         $param_line .= $param_value != '' ? fieldAttachedImages(explode(",", $param_value)) : '';
                                         $param_line .= '</ul>';
                                         $param_line .= '</div>';
                                         $param_line .= '<div class="gallery_widget_site_images">';
                                         $param_line .= siteAttachedImages(explode(",", $param_value));
                                         $param_line .= '</div>';
                                         $param_line .= '<div class="wpb_clear"></div>';
                                     } else {
                                         if ($param['type'] == 'attach_image') {
                                             // TODO: More native way
                                             $param_value = wpb_removeNotExistingImgIDs(preg_replace('/[^\\d]/', '', $param_value));
                                             $param_line .= '<input type="hidden" class="wpb_vc_param_value gallery_widget_attached_images_ids ' . $param['param_name'] . ' ' . $param['type'] . '" name="' . $param['param_name'] . '" value="' . $param_value . '" />';
                                             $param_line .= '<a class="button gallery_widget_add_images" href="#" use-single="true" title="' . __('Add image', "js_composer") . '">' . __('Add image', "js_composer") . '</a>';
                                             $param_line .= '<div class="gallery_widget_attached_images">';
                                             $param_line .= '<ul class="gallery_widget_attached_images_list">';
                                             $param_line .= $param_value != '' ? fieldAttachedImages(explode(",", $param_value)) : '';
                                             $param_line .= '</ul>';
                                             $param_line .= '</div>';
                                             $param_line .= '<div class="gallery_widget_site_images">';
                                             $param_line .= siteAttachedImages(explode(",", $param_value));
                                             $param_line .= '</div>';
                                             $param_line .= '<div class="wpb_clear"></div>';
                                         } else {
//.........这里部分代码省略.........
开发者ID:nilmadhab,项目名称:webtutplus,代码行数:101,代码来源:shortcodes.php

示例5: singleParamEditForm

 protected function singleParamEditForm($param, $param_value)
 {
     $param_line = '';
     $dependency = '';
     if (!empty($param['dependency']) && isset($param['dependency']['element'])) {
         $dependency = ' data-dependency-element="true"';
     }
     // Textfield - input
     if ($param['type'] == 'textfield') {
         $value = __($param_value, "js_composer");
         $value = $param_value;
         $param_line .= '<input name="' . $param['param_name'] . '" class="wpb_vc_param_value wpb-textinput ' . $param['param_name'] . ' ' . $param['type'] . '" type="text" value="' . $value . '" ' . $dependency . '/>';
     } else {
         if ($param['type'] == 'dropdown') {
             $param_line .= '<select name="' . $param['param_name'] . '" class="wpb_vc_param_value wpb-input wpb-select ' . $param['param_name'] . ' ' . $param['type'] . '"' . $dependency . '>';
             foreach ($param['value'] as $text_val => $val) {
                 if (is_numeric($text_val) && is_string($val) || is_numeric($text_val) && is_numeric($val)) {
                     $text_val = $val;
                 }
                 $text_val = __($text_val, "js_composer");
                 $val = strtolower(str_replace(array(" "), array("_"), $val));
                 $selected = '';
                 if ($val == $param_value) {
                     $selected = ' selected="selected"';
                 }
                 $param_line .= '<option class="' . $val . '" value="' . $val . '"' . $selected . '>' . $text_val . '</option>';
             }
             $param_line .= '</select>';
         } else {
             if ($param['type'] == 'textarea_html') {
                 $param_line .= do_shortcode_param_settings_field('textarea_html', $param, $param_value);
                 // $param_line .= $this->getTinyHtmlTextArea($param, $param_value, $dependency);
             } else {
                 if ($param['type'] == 'posttypes') {
                     $param_line .= '<input class="wpb_vc_param_value wpb-checkboxes" type="hidden" value="" name="" ' . $dependency . '/>';
                     $args = array('public' => true);
                     $post_types = get_post_types($args);
                     foreach ($post_types as $post_type) {
                         $checked = "";
                         if ($post_type != 'attachment') {
                             if (in_array($post_type, explode(",", $param_value))) {
                                 $checked = ' checked="checked"';
                             }
                             $param_line .= ' <input id="' . $param['param_name'] . '-' . $post_type . '" value="' . $post_type . '" class="' . $param['param_name'] . ' ' . $param['type'] . '" type="checkbox" name="' . $param['param_name'] . '"' . $checked . '' . $dependency . '> ' . $post_type;
                         }
                     }
                 } else {
                     if ($param['type'] == 'taxomonies') {
                         $param_line .= '<input class="wpb_vc_param_value wpb-checkboxes" type="hidden" value="" name="" ' . $dependency . '/>';
                         $post_types = get_post_types(array('public' => false, 'name' => 'attachment'), 'names', 'NOT');
                         foreach ($post_types as $type) {
                             $taxonomies = get_object_taxonomies($type, '');
                             foreach ($taxonomies as $tax) {
                                 $checked = "";
                                 if (in_array($tax->name, explode(",", $param_value))) {
                                     $checked = ' checked="checked"';
                                 }
                                 $param_line .= ' <label data-post-type="' . $type . '"><input id="' . $param['param_name'] . '-' . $tax->name . '" value="' . $tax->name . '" data-post-type="' . $type . '" class="' . $param['param_name'] . ' ' . $param['type'] . '" type="checkbox" name="' . $param['param_name'] . '"' . $checked . '' . $dependency . '> ' . $tax->label . '</label>';
                             }
                         }
                     } else {
                         if ($param['type'] == 'exploded_textarea') {
                             $param_value = str_replace(",", "\n", $param_value);
                             $param_line .= '<textarea name="' . $param['param_name'] . '" class="wpb_vc_param_value wpb-textarea ' . $param['param_name'] . ' ' . $param['type'] . '"' . $dependency . '>' . $param_value . '</textarea>';
                         } else {
                             if ($param['type'] == 'textarea_raw_html') {
                                 // $param_value = __($param_value, "js_composer");
                                 $param_line .= '<textarea name="' . $param['param_name'] . '" class="wpb_vc_param_value wpb-textarea_raw_html ' . $param['param_name'] . ' ' . $param['type'] . '" rows="16"' . $dependency . '>' . htmlentities(rawurldecode(base64_decode($param_value)), ENT_COMPAT, 'UTF-8') . '</textarea>';
                             } else {
                                 if ($param['type'] == 'textarea') {
                                     $param_value = __($param_value, "js_composer");
                                     $param_line .= '<textarea name="' . $param['param_name'] . '" class="wpb_vc_param_value wpb-textarea ' . $param['param_name'] . ' ' . $param['type'] . '"' . $dependency . '>' . $param_value . '</textarea>';
                                 } else {
                                     if ($param['type'] == 'attach_images') {
                                         // TODO: More native way
                                         $param_value = wpb_removeNotExistingImgIDs($param_value);
                                         $param_line .= '<input type="hidden" class="wpb_vc_param_value gallery_widget_attached_images_ids ' . $param['param_name'] . ' ' . $param['type'] . '" name="' . $param['param_name'] . '" value="' . $param_value . '" ' . $dependency . '/>';
                                         //$param_line .= '<a class="button gallery_widget_add_images" href="#" title="'.__('Add images', "js_composer").'">'.__('Add images', "js_composer").'</a>';
                                         $param_line .= '<div class="gallery_widget_attached_images">';
                                         $param_line .= '<ul class="gallery_widget_attached_images_list">';
                                         $param_line .= $param_value != '' ? fieldAttachedImages(explode(",", $param_value)) : '';
                                         $param_line .= '</ul>';
                                         $param_line .= '</div>';
                                         $param_line .= '<div class="gallery_widget_site_images">';
                                         // $param_line .= siteAttachedImages(explode(",", $param_value));
                                         $param_line .= '</div>';
                                         $param_line .= '<a class="gallery_widget_add_images" href="#" title="' . __('Add images', "js_composer") . '">' . __('Add images', "js_composer") . '</a>';
                                         //class: button
                                         //$param_line .= '<div class="wpb_clear"></div>';
                                     } else {
                                         if ($param['type'] == 'attach_image') {
                                             $param_value = wpb_removeNotExistingImgIDs(preg_replace('/[^\\d]/', '', $param_value));
                                             $param_line .= '<input type="hidden" class="wpb_vc_param_value gallery_widget_attached_images_ids ' . $param['param_name'] . ' ' . $param['type'] . '" name="' . $param['param_name'] . '" value="' . $param_value . '" ' . $dependency . '/>';
                                             //$param_line .= '<a class="button gallery_widget_add_images" href="#" use-single="true" title="'.__('Add image', "js_composer").'">'.__('Add image', "js_composer").'</a>';
                                             $param_line .= '<div class="gallery_widget_attached_images">';
                                             $param_line .= '<ul class="gallery_widget_attached_images_list">';
                                             $param_line .= $param_value != '' ? fieldAttachedImages(explode(",", $param_value)) : '';
                                             $param_line .= '</ul>';
                                             $param_line .= '</div>';
                                             $param_line .= '<div class="gallery_widget_site_images">';
//.........这里部分代码省略.........
开发者ID:unisexx,项目名称:drtooth,代码行数:101,代码来源:shortcodes.php


注:本文中的wpb_removeNotExistingImgIDs函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。