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

PHP wp_get_attachment_thumb_url函数代码示例

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

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



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

示例1: mtheme_portfolio_custom_columns

 function mtheme_portfolio_custom_columns($column)
 {
     global $post;
     $custom = get_post_custom();
     $image_url = wp_get_attachment_thumb_url(get_post_thumbnail_id($post->ID));
     $full_image_id = get_post_thumbnail_id($post->ID, 'thumbnail');
     $full_image_url = wp_get_attachment_image_src($full_image_id, 'thumbnail');
     $full_image_url = $full_image_url[0];
     if (!defined('MTHEME')) {
         $mtheme_shortname = "mtheme_p2";
         define('MTHEME', $mtheme_shortname);
     }
     switch ($column) {
         case "portfolio_image":
             if (isset($image_url)) {
                 echo '<a class="thickbox" href="' . $full_image_url . '"><img src="' . $image_url . '" width="60px" height="60px" alt="featured" /></a>';
             } else {
                 echo __('Image not found', 'mthemelocal');
             }
             break;
         case "description":
             if (isset($custom[MTHEME . '_thumbnail_desc'][0])) {
                 echo $custom[MTHEME . '_thumbnail_desc'][0];
             }
             break;
         case "video":
             if (isset($custom[MTHEME . '_lightbox_video'][0])) {
                 echo $custom[MTHEME . '_lightbox_video'][0];
             }
             break;
         case "types":
             echo get_the_term_list($post->ID, 'types', '', ', ', '');
             break;
     }
 }
开发者ID:rongandat,项目名称:scalaprj,代码行数:35,代码来源:imaginem-portfolio-posts.php


示例2: mtheme_fullscreen_custom_columns

 function mtheme_fullscreen_custom_columns($column)
 {
     global $post;
     $custom = get_post_custom();
     $image_url = wp_get_attachment_thumb_url(get_post_thumbnail_id($post->ID));
     $full_image_id = get_post_thumbnail_id($post->ID, 'thumbnail');
     $full_image_url = wp_get_attachment_image_src($full_image_id, 'thumbnail');
     $full_image_url = $full_image_url[0];
     if (!defined('MTHEME')) {
         $mtheme_shortname = "mtheme_p2";
         define('MTHEME', $mtheme_shortname);
     }
     switch ($column) {
         case "featured_image":
             if (isset($image_url)) {
                 echo '<a class="thickbox" href="' . $full_image_url . '"><img src="' . $image_url . '" width="40px" height="40px" alt="featured" /></a>';
             } else {
                 echo 'Image not found';
             }
             break;
         case "featured_description":
             if (isset($custom["featured_description"][0])) {
                 echo $custom["featured_description"][0];
             }
             break;
         case "fullscreen_type":
             if (isset($custom["fullscreen_type"][0])) {
                 echo $custom["fullscreen_type"][0];
             }
             break;
     }
 }
开发者ID:rongandat,项目名称:scalaprj,代码行数:32,代码来源:imaginem-fullscreen-posts.php


示例3: display_images_from_media_library

function display_images_from_media_library($type, $mediaID = NULL)
{
    if ($type == 'bg') {
        $thumb_type = 'st-bg-thumb';
    } else {
        $thumb_type = 'st-thumb';
    }
    if ($mediaID == NULL || $mediaID == 0) {
        $image_return = '<img style="opacity: 1; filter: alpha(opacity=100);" width="80" height="80" class="thumb ' . $thumb_type . '" src="' . plugins_url('images/no-image.png', __FILE__) . '" alt="" data-pid="" />';
    } else {
        $image_return = '<img style="opacity: 0.2; filter: alpha(opacity=2);" width="80" height="80" class="thumb ' . $thumb_type . '" src="' . plugins_url('images/no-image.png', __FILE__) . '" alt="" data-pid="" />';
    }
    $images = get_children(array('post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order'));
    if ($images) {
        foreach ($images as $id => $image) {
            $opacity_out = 'style="opacity: 0.2; filter: alpha(opacity=2);"';
            if ($mediaID !== NULL) {
                if ($image->ID == $mediaID) {
                    $opacity_out = 'style="opacity: 1; filter: alpha(opacity=100);"';
                }
            }
            $img = wp_get_attachment_thumb_url($image->ID);
            $image_return .= '<img ' . @$opacity_out . 'width="80" height="80" class="thumb ' . $thumb_type . '" src="' . $img . '" alt="" data-pid="' . $image->ID . '" />';
        }
    }
    return $image_return;
}
开发者ID:northmedia,项目名称:emailWP,代码行数:27,代码来源:admin.squeeze-pages.php


示例4: output

 /**
  * Check AM_MBF for description.
  *
  * @todo Set class on div to set if the image has been selected and get rid of $hide_upload_button and $hide_clear_button.
  *
  * @since 1.0.0
  */
 public function output()
 {
     // Get the file id, 0 represents a new field.
     $image_id = intval($this->value) > 0 ? intval($this->value) : 0;
     $image_url = '';
     $image_title = '';
     $class_icon = '';
     $hide_upload_button = $hide_clear_button = ' style="display:none;"';
     // Make sure the selected image is valid.
     if ($image_id > 0) {
         $post = get_post($image_id);
         if (isset($post) && wp_attachment_is_image($image_id)) {
             $image_url = wp_get_attachment_thumb_url($image_id);
             $image_title = $post->post_title;
         } else {
             $this->error = __(sprintf('Selected Image (ID:%1$d) is invalid.', $image_id), 'am-cpts');
             $class_icon = ' invalid';
         }
         $hide_clear_button = '';
     } else {
         $hide_upload_button = '';
     }
     // Text used by wp.media frame.
     $wp_media_data = sprintf(' data-title="%1$s" data-button="%2$s"', esc_attr__('Choose an Image', 'am-cpts'), esc_attr__('Use this Image', 'am-cpts'));
     return sprintf('
   <div%11$s>
     <input name="%2$s" type="hidden" class="meta-box-upload-image" value="%1$d"%12$s />
     <img src="%10$s" class="meta-box-preview-image%3$s" title="%7$s" alt="%6$s"%5$s />
     <a href="#" class="meta-box-upload-image-button button"%4$s%13$s>%8$s</a>
     <span class="meta-box-image-title"%5$s>%6$s</span>
     <a href="#" class="meta-box-clear-image-button"%5$s>%9$s</a>
   </div>', esc_attr($image_id), esc_attr($this->name), $class_icon, $hide_upload_button, $hide_clear_button, isset($this->error) ? esc_html($this->error) : $image_title, esc_attr__('Selected Image', 'am-cpts'), esc_html__('Choose Image', 'am-cpts'), esc_html__('Remove Image', 'am-cpts'), esc_url($image_url), $this->get_classes('meta-box-image'), $this->get_data_atts(), $wp_media_data);
 }
开发者ID:noplanman,项目名称:am-cpts,代码行数:40,代码来源:image.php


示例5: mtheme_sort_portfolio

/**
 * Display Sort admin
 *
 * @return void
 * @author Soul
 **/
function mtheme_sort_portfolio()
{
    $portfolio = new WP_Query('post_type=mtheme_portfolio&posts_per_page=-1&orderby=menu_order&order=ASC');
    ?>
	<div class="wrap">
	<h2>Sort portfolio Slides<img src="<?php 
    echo home_url();
    ?>
/wp-admin/images/loading.gif" id="loading-animation" /></h2>
	<div class="description">
	Drag and Drop the slides to order them
	</div>
	<ul id="portfolio-list">
	<?php 
    while ($portfolio->have_posts()) {
        $portfolio->the_post();
        ?>
		<li id="<?php 
        the_id();
        ?>
">
		<div>
		<?php 
        $image_url = wp_get_attachment_thumb_url(get_post_thumbnail_id());
        $custom = get_post_custom(get_the_ID());
        $portfolio_cats = get_the_terms(get_the_ID(), 'types');
        ?>
		<?php 
        if ($image_url) {
            echo '<img class="mtheme_admin_sort_image" src="' . $image_url . '" width="30px" height="30px" alt="" />';
        }
        ?>
		<span class="mtheme_admin_sort_title"><?php 
        the_title();
        ?>
</span>
		<?php 
        if ($portfolio_cats) {
            ?>
		<span class="mtheme_admin_sort_categories"><?php 
            foreach ($portfolio_cats as $taxonomy) {
                echo ' | ' . $taxonomy->name;
            }
            ?>
</span>
		<?php 
        }
        ?>
		</div>

		</li>
	<?php 
    }
    ?>
	</div><!-- End div#wrap //-->
 
<?php 
}
开发者ID:rongandat,项目名称:scalaprj,代码行数:64,代码来源:portfolio-post-sorter.php


示例6: lightbox_func

/**
 * Shortcode function for Lightbox2
 *
 * @see [lightbox name="gallery" post="1"]
 * @param $atts
 * @param null $content
 */
function lightbox_func($atts, $content = null)
{
    $a = shortcode_atts(array('name' => 'lightbox', 'class' => 'lightbox'), $atts);
    wp_register_script('lightbox', YONK_URL . 'assets/js/lightbox.min.js', false, '2.8.2');
    wp_enqueue_script('lightbox');
    wp_register_style('lightbox', YONK_URL . 'assets/css/lightbox.min.css', false, '2.8.2', 'all');
    wp_enqueue_style('lightbox');
    if (!isset($a['post'])) {
        global $post;
        $p = $post;
    } else {
        $p = get_post(intval($a['post']));
    }
    $image_urls = explode('~~~', Yonk_Frontend::get_meta('gallery_attachments', $p));
    ob_start();
    ?>
	<div style="position:relative;">
		<div id="<?php 
    echo $a['name'];
    ?>
" class="<?php 
    echo $a['class'];
    ?>
">
<?php 
    foreach ($image_urls as $url) {
        $attachment_id = get_attachment_id($url);
        $attachment = get_post($attachment_id);
        ?>

		<a href="<?php 
        echo $url;
        ?>
" data-lightbox="<?php 
        echo $a['name'];
        ?>
" data-title="<?php 
        echo $attachment->post_excerpt;
        ?>
">
			<img src="<?php 
        echo wp_get_attachment_thumb_url($attachment_id);
        ?>
" alt="<?php 
        echo $attachment->post_title;
        ?>
" />
		</a>

		<?php 
    }
    ?>
		</div>
	</div>
<?php 
    return ob_get_clean();
}
开发者ID:Patreo,项目名称:yonk,代码行数:64,代码来源:Sc_lightbox.php


示例7: qeui_add_thumbnail_callback

function qeui_add_thumbnail_callback()
{
    $thumb_id = $_POST['thumb_id'];
    $post_id = $_POST['post_id'];
    $thumbnail = wp_get_attachment_thumb_url($thumb_id);
    update_post_meta($post_id, '_thumbnail_id', $thumb_id);
    echo json_encode(array('post_id' => $post_id, 'img_url' => $thumbnail, 'thumb_id' => $thumb_id));
    die;
}
开发者ID:asheu321,项目名称:wp-qeui,代码行数:9,代码来源:wp-qeui.php


示例8: getImages

 public static function getImages($brochure)
 {
     $images = array();
     foreach ($brochure['image_gallery'] as $image) {
         $row['image_url'] = wp_get_attachment_url($image);
         $row['thumbnail_url'] = wp_get_attachment_thumb_url($image);
         $row['thumbnail_image'] = wp_get_attachment_image($image);
         $images[] = $row;
     }
     return $images;
 }
开发者ID:gabzon,项目名称:experiensa,代码行数:11,代码来源:brochure.php


示例9: get_avatar

 /**
  * Get an customer avatar
  *
  * @param  integer  avatar size in pixels
  *
  * @return string  image with HTML tag
  */
 public function get_avatar($size = 32)
 {
     if ($this->id) {
         $user_photo_id = $this->get_meta('photo_id', true);
         if (!empty($user_photo_id)) {
             $image = wp_get_attachment_thumb_url($user_photo_id);
             return sprintf('<img src="%1$s" alt="" class="avatar avatar-%2$s photo" height="auto" width="%2$s" />', $image, $size);
         }
     }
     return get_avatar($this->email, $size);
 }
开发者ID:ediamin,项目名称:wp-erp,代码行数:18,代码来源:class-contact.php


示例10: echo_first_image

function echo_first_image($postID)
{
    $args = array('numberposts' => 1, 'order' => 'ASC', 'post_mime_type' => 'image', 'post_parent' => $postID, 'post_status' => null, 'post_type' => 'attachment');
    $attachments = get_children($args);
    if ($attachments) {
        foreach ($attachments as $attachment) {
            $image_attributes = wp_get_attachment_image_src($attachment->ID, 'thumbnail') ? wp_get_attachment_image_src($attachment->ID, 'thumbnail') : wp_get_attachment_image_src($attachment->ID, 'full');
            echo '<img src="' . wp_get_attachment_thumb_url($attachment->ID) . '">';
        }
    }
}
开发者ID:doobas,项目名称:kazinopaslaptys,代码行数:11,代码来源:functions.php


示例11: add_post_meta

        add_post_meta($post_ID, 'mgop_media_value', $data, true) or update_post_meta($post_ID, 'mgop_media_value', $data);
    }
    public function mb_callback($post, $box)
    {
        $value = get_post_meta($post->ID, 'mgop_media_value', true);
        $value = isset($value[$box['id']]) ? $value[$box['id']] : array();
        wp_nonce_field(plugin_basename(__FILE__), 'mgop_noncename');
        ?>
		
		<a href="#" class="mgop_add" data-for="<?php 
        echo $box['id'];
        ?>
" title="<?php 
        echo $box['title'];
        ?>
">Add Image</a>
		<ul id="mgop_<?php 
        echo $box['id'];
        ?>
" class="mgop-wrapper-sortable">
			<?php 
        if (is_array($value) && count($value)) {
            foreach ($value as $attc_id) {
                $url = wp_get_attachment_thumb_url($attc_id);
                ?>
				<li class="mgop_thumnails" title="Drag and drop to sort the item"><div><span class="mgop-movable"></span><a href="#" class="mgop_remove_item" title="Click to delete this item"><span>delete</span></a><img src="<?php 
                echo $url;
                ?>
"><input type="hidden" name="mgop_media[<?php 
                echo $box['id'];
                ?>
][]" value="<?php 
                echo $attc_id;
                ?>
" /></div></li>
			<?php 
            }
        }
        ?>
		</ul>
		<div class="mgop-detail" style="border-top: 1px solid #ccc;">
			<ul>
				<li><label>Gallery Slug</label>: <code><?php 
        echo $box['args']['slug'];
        ?>
</code></li>
				<li><label>Output Location</label>: <?php 
        echo $this->positions[$box['args']['position']];
        ?>
</li>
开发者ID:PDKK,项目名称:magnific-gallery,代码行数:50,代码来源:metabox.php


示例12: erp_crm_get_avatar

/**
 * Get an avatar avatar
 *
 * @param  integer  avatar size in pixels
 *
 * @return string  image with HTML tag
 */
function erp_crm_get_avatar($id, $size = 32, $user = false)
{
    if ($id) {
        if ($user) {
            return get_avatar($id, $size);
        }
        $user_photo_id = erp_people_get_meta($id, 'photo_id', true);
        if (!empty($user_photo_id)) {
            $image = wp_get_attachment_thumb_url($user_photo_id);
            return sprintf('<img src="%1$s" alt="" class="avatar avatar-%2$s photo" height="auto" width="%2$s" />', $image, $size);
        }
    }
    return get_avatar($id, $size);
}
开发者ID:ediamin,项目名称:wp-erp,代码行数:21,代码来源:function-customer.php


示例13: uz_ui_load_more_images

function uz_ui_load_more_images()
{
    global $wpdb;
    $offset = esc_sql($_GET['offset']);
    $offset = $offset ? $offset * 25 : 0;
    $images = $wpdb->get_results(" SELECT ID FROM {$wpdb->posts} WHERE post_type = 'attachment' AND post_mime_type LIKE 'image%' ORDER BY post_date DESC LIMIT {$offset},25 ");
    foreach ($images as $key => $image) {
        $images[$key]->url = wp_get_attachment_thumb_url($image->ID);
    }
    if (count($images) > 0) {
        echo json_encode($images);
    }
    die;
}
开发者ID:vuzzu,项目名称:utilizer-ui-elements,代码行数:14,代码来源:image_library_input.php


示例14: edit_automobile_category_fields

function edit_automobile_category_fields($term)
{
    global $autoMobile;
    $automobile_category_extra_fields = get_option('automobile_category_images');
    $thumbnail_id = absint($automobile_category_extra_fields[$term->term_id]['automobile_category_images']);
    if ($thumbnail_id) {
        $image = wp_get_attachment_thumb_url($thumbnail_id);
    } else {
        $image = $autoMobile->auto_mobile_default_image();
    }
    ?>
		
		<tr class="form-field">
			<th scope="row" valign="top"><label><?php 
    echo _e('Thumbnail', 'automobileoptions');
    ?>
</label></th>
			<td>
				<div id="automobile_product_category_thumbnail" style="float: left; margin-right: 10px;"><img src="<?php 
    echo esc_url($image);
    ?>
" width="60px" height="60px" /></div>
				<div style="line-height: 60px;">
					<input type="hidden" id="automobile_product_category_thumbnail_id" name="automobile_product_category_thumbnail_id" value="<?php 
    echo $thumbnail_id;
    ?>
" />
					<button type="button" class="upload_image_button button"><?php 
    echo _e('Upload/Add image', 'automobileoptions');
    ?>
</button>
					<button type="button" class="remove_image_button button"><?php 
    echo _e('Remove image', 'automobileoptions');
    ?>
</button>
				</div>
<script type="text/javascript">

					// Only show the "remove image" button when needed
					if ( '0' === jQuery( '#automobile_product_category_thumbnail_id' ).val() ) {
						jQuery( '.remove_image_button' ).hide();
					}
					
				</script>				
				<div class="clear"></div>
			</td>
		</tr>
		<?php 
}
开发者ID:jakiir,项目名称:auto-mobile,代码行数:49,代码来源:atm-category-function.php


示例15: widget

    /**
     * Outputs the content of the widget
     *
     * @param array $args
     * @param array $instance
     */
    public function widget($args, $instance) {
        $title = apply_filters('widget_title', $instance['title']);
        $imgWidth = apply_filters('widget_img_width', $instance['img_width']);
        $imgHight = apply_filters('widget_img_height', $instance['img_height']);
        $gallery_images = apply_filters('gallery_images', $instance['gallery_images']);
        $gallery_images = !empty($gallery_images) ? maybe_unserialize($gallery_images) : false;
        echo $args['before_widget'];

        if (!empty($title)) {
            echo $args['before_title'] . $title . $args['after_title'];
        }

        if (!empty($gallery_images)) {
            $carousel = '<div class="gallery-popup-wrap">';
            $carousel .= sprintf('<div id="gallery-%s" class="popup-gallery">', $args['widget_id']);
            foreach ($gallery_images as $attachment_id) {
                $image = wp_get_attachment_image_src($attachment_id, 'full');
                
                $thumb_url = wp_get_attachment_thumb_url($attachment_id);
                $carousel .= sprintf('<div class="gallery-item"><a href="%1$s"><img src="%2$s" alt="gallery-image" width="%3$s" height="%4$s" alt="Gallery Image"></a></div>', $image[0], $thumb_url, $imgWidth, $imgHight);
            }
            $carousel .= '</div>';
            $carousel .= '</div>';
            $nav = ($carousel_nav == 'yes') ? 'true' : 'false';
            $dot = ($carousel_dot == 'yes') ? 'true' : 'false';
            $autoplay = ($carousel_autoplay == 'yes') ? 'true' : 'false';
            $item = !empty($image_display) ? $image_display : 1;
            echo $carousel;
            ?>
            <script type="text/javascript">
                jQuery(document).ready(function () {
                    if (typeof jQuery.fn.magnificPopup !== 'undefined') {
                        jQuery('.popup-gallery').magnificPopup({
                            type: 'image',
                            delegate: 'a',
                            gallery: {
                                enabled: true
                            }
                        });
                    }
                    console.log(typeof jQuery.fn.magnificPopup);
                });
            </script>
            <?php
        }
        echo '<div class="clearfix"></div>';
        echo $args['after_widget'];
    }
开发者ID:ergov2015,项目名称:rideflag,代码行数:54,代码来源:widgets-gallery.php


示例16: igallery_ajax_req

 public function igallery_ajax_req()
 {
     $nonce = $_POST['i_nonce'];
     if (!wp_verify_nonce($nonce, 'igallery-nonce-default')) {
         die('Busted!');
     }
     $at_id = $_POST['attachementID'];
     $post_thumb = wp_get_attachment_thumb_url($at_id);
     if (!$post_thumb) {
         $post_thumb = 'http://placehold.it/150x150';
     }
     $response = json_encode(array('thumb_url' => $post_thumb));
     header("Content-Type: application/json");
     echo $response;
     exit;
 }
开发者ID:wiratama,项目名称:gardenbal,代码行数:16,代码来源:plugin_core.php


示例17: nautilus_get_post_thumbnail

function nautilus_get_post_thumbnail($post_id)
{
    $thumb_url = wp_cache_get($post_id, 'post_thumbs');
    if (false !== $thumb_url) {
        return $thumb_url;
    } else {
        $thumb_url = '';
        $rows =& get_children("post_parent={$post_id}&post_type=attachment&numberposts=1");
        if ($rows) {
            $attachment = array_shift($rows);
            $thumb_url = wp_get_attachment_thumb_url($attachment->ID);
        }
        wp_cache_add($post_id, $thumb_url, 'post_thumbs');
        return $thumb_url;
    }
}
开发者ID:rmccue,项目名称:wordpress-unit-tests,代码行数:16,代码来源:functions.php


示例18: get_cats

function get_cats()
{
    $catTerms = get_terms('product_cat', array('hide_empty' => 0, 'include' => '1422, 1344, 984, 1446, 1000, 1050, 996, 975, 987, 1016, 994, 564, 1186, 1048, 654, 1135, 645, 1445'));
    $ch_n = 0;
    if ($catTerms) {
        echo '<ul class="ch-grid">';
        foreach ($catTerms as $catTerm) {
            $thumbnail_id = get_woocommerce_term_meta($catTerm->term_id, 'thumbnail_id', true);
            $image = wp_get_attachment_thumb_url($thumbnail_id);
            $ch_n++;
            echo '<li><a title="Перейти" href="/products/' . $catTerm->slug . '"><div class="ch-item" style="background-image: url(' . $image . '); background-size: 80%; background-repeat: no-repeat; background-color: white;"><div class="ch-info"><h3>' . $catTerm->name . '</h3></div></div></a></li>';
        }
        wp_reset_query();
        echo '</ul>';
    }
}
开发者ID:almone,项目名称:wc_hacks,代码行数:16,代码来源:wc_hacks.php


示例19: render_input

 function render_input($args, $images = "", $default_selected = "")
 {
     // nm_personalizedproduct_pa($images);
     $_html = '<div class="pre_upload_image_box">';
     $img_index = 0;
     $popup_width = $args['popup-width'] == '' ? 600 : $args['popup-width'];
     $popup_height = $args['popup-height'] == '' ? 450 : $args['popup-height'];
     if ($images) {
         foreach ($images as $image) {
             $_html .= '<div class="pre_upload_image">';
             if ($image['id'] != '') {
                 $_html .= '<img src="' . wp_get_attachment_thumb_url($image['id']) . '" />';
             } else {
                 $_html .= '<img width="150" height="150" src="' . $image['link'] . '" />';
             }
             // for bigger view
             $_html .= '<div style="display:none" id="pre_uploaded_image_' . $args['id'] . '-' . $img_index . '"><img style="margin: 0 auto;display: block;" src="' . $image['link'] . '" /></div>';
             $_html .= '<div class="input_image">';
             if ($args['multiple-allowed'] == 'on') {
                 $_html .= '<input type="checkbox" data-price="' . $image['price'] . '" data-title="' . stripslashes($image['title']) . '" name="' . $args['name'] . '[]" value="' . esc_attr(json_encode($image)) . '" />';
             } else {
                 //default selected
                 $checked = $image['title'] == $default_selected ? 'checked = "checked"' : '';
                 $_html .= '<input type="radio" data-price="' . $image['price'] . '" data-title="' . stripslashes($image['title']) . '" data-type="' . stripslashes($args['data-type']) . '" name="' . $args['name'] . '" value="' . esc_attr(json_encode($image)) . '" ' . $checked . ' />';
             }
             $price = '';
             if (function_exists('woocommerce_price') && $image['price'] > 0) {
                 $price = woocommerce_price($image['price']);
             }
             // image big view
             $_html .= '<a href="#TB_inline?width=' . $popup_width . '&height=' . $popup_height . '&inlineId=pre_uploaded_image_' . $args['id'] . '-' . $img_index . '" class="thickbox" title="' . $image['title'] . '"><img width="15" src="' . $this->plugin_meta['url'] . '/images/zoom.png" /></a>';
             $_html .= '<div class="p_u_i_name">' . stripslashes($image['title']) . ' ' . $price . '</div>';
             $_html .= '</div>';
             //input_image
             $_html .= '</div>';
             $img_index++;
         }
     }
     $_html .= '<div style="clear:both"></div>';
     //container_buttons
     $_html .= '</div>';
     //container_buttons
     echo $_html;
     $this->get_input_js($args);
 }
开发者ID:GermansRegi,项目名称:wordpress-bacicleta,代码行数:45,代码来源:input.image.php


示例20: get_photo_details

 static function get_photo_details($image_id)
 {
     $image_info_array = array();
     $thumb_url = wp_get_attachment_thumb_url($image_id);
     $attachment_img = wp_get_attachment_image($image_id);
     $alt_text = get_post_meta($image_id, '_wp_attachment_image_alt', true);
     $image_post = get_post($image_id);
     $image_desc = $image_post->post_content;
     $upload_date = $image_post->post_date;
     $galley_id = get_post_meta($image_id, '_wppg_gallery_id', true);
     //if the alt text meta is blank, let's set it to the image name
     if ($alt_text == '' || $alt_text == NULL) {
         $alt_text = $image_post->post_name;
     }
     $image_info = array('id' => $image_id, 'gallery_id' => $galley_id, 'thumb_url' => $thumb_url, 'alt_text' => $alt_text, 'description' => $image_desc, 'date_uploaded' => $upload_date);
     $image_info_array = $image_info;
     return $image_info_array;
 }
开发者ID:acamboy,项目名称:kutetheme-wp,代码行数:18,代码来源:wppg-photo-gallery-item-class.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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