• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP fieldAttachedImages函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



在下文中一共展示了fieldAttachedImages函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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: galleryHTML

 /**
  * Todo: move it
  * @since 4.2
  */
 public function galleryHTML()
 {
     $images = vc_post_param('content');
     if (!empty($images)) {
         echo fieldAttachedImages(explode(",", $images));
     }
     die;
 }
开发者ID:polaris610,项目名称:medicalhound,代码行数:12,代码来源:class-vc-base.php


示例3: galleryHTMLJavascript_callback

 public function galleryHTMLJavascript_callback()
 {
     $images = $this->post('content');
     if (!empty($images)) {
         echo fieldAttachedImages(explode(",", $images));
     }
     die;
 }
开发者ID:venamax,项目名称:trixandtrax-cl,代码行数:8,代码来源:composer.php


示例4: 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


示例5: galleryHTML

 /**
  * @todo move it
  * @since 4.2
  */
 public function galleryHTML()
 {
     // @todo again, this method should be moved (comment added on 4.8)
     vc_user_access()->checkAdminNonce()->validateDie()->wpAny('edit_posts', 'edit_pages')->validateDie();
     $images = vc_post_param('content');
     if (!empty($images)) {
         echo fieldAttachedImages(explode(',', $images));
     }
     die;
 }
开发者ID:hikaram,项目名称:wee,代码行数:14,代码来源:class-vc-base.php


示例6: fws_image_settings_field

function fws_image_settings_field($param, $value)
{
    $param_line = '';
    $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="' . $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">';
    if (strpos($value, "http://") !== false || strpos($value, "https://") !== false) {
        //$param_value = fjarrett_get_attachment_id_by_url($param_value);
        $param_line .= '<li class="added">
				<img src="' . $value . '" />
				<a href="#" class="icon-remove"></a>
			</li>';
    } else {
        $param_line .= $value != '' ? fieldAttachedImages(explode(",", $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>';
    return $param_line;
}
开发者ID:JPodz,项目名称:harlequinnejuice,代码行数:26,代码来源:nectar-addons.php


示例7: 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


示例8: singleParamEditForm


//.........这里部分代码省略.........
                             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();
                                                         $sidebars = $GLOBALS['wp_registered_sidebars'];
                                                         $param_line .= '<select name="' . $param['param_name'] . '" class="wpb_vc_param_value dropdown wpb-input wpb-select ' . $param['param_name'] . ' ' . $param['type'] . '">';
                                                         foreach ($sidebars as $sidebar) {
                                                             $selected = '';
                                                             if ($sidebar["id"] == $param_value) {
开发者ID:Beutiste,项目名称:wordpress,代码行数:67,代码来源:shortcodes.php


示例9: galleryHTML

 /**
  * @todo move it
  * @since 4.2
  */
 public function galleryHTML()
 {
     if (!vc_verify_admin_nonce() || !current_user_can('edit_posts') && !current_user_can('edit_pages')) {
         wp_send_json(array('success' => false));
     }
     $images = vc_post_param('content');
     if (!empty($images)) {
         echo fieldAttachedImages(explode(',', $images));
     }
     die;
 }
开发者ID:AntonioColeman,项目名称:Clairvoyant,代码行数:15,代码来源:class-vc-base.php


示例10: 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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP field_cache_clear函数代码示例发布时间:2022-05-15
下一篇:
PHP field函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap