My Upload Images

My Upload Images

توسط

This plugin create the metabox with the media uploader into any post types. In the metabox, You can drag images into any order you like. The IDs and the order of images will put on record in the customfield of your posts as array.

Attention

Available only for WordPress 4.0+.

  1. Copy the ‘my-upload-images’ folder into your plugins folder.
  2. Activate the plugin via the ‘Plugins‘ admin page. The plugin requires the setup of selecting post_types which you want to add metabox.

Example usage

The image IDs are stored in [‘my_upload_images’] custom field. When to output the IDs into your template file, write codes like below.

Output images and links.
ID, ‘my_upload_images’, true );
if ( $my_upload_images ): foreach( $my_upload_images as $img_id ):
$full_src = wp_get_attachment_image_src ($img_id,’fullsize’);
if ( !$full_src ) continue;
echo
‘.wp_get_attachment_image ($img_id,’thumbnail’).’‘.”n”;
endforeach; endif;
?>

Output images and links with attributes.
ID, ‘my_upload_images’, true );
$slider = ”;
if ( $my_upload_images ):
foreach( $my_upload_images as $img_id ):
$full_src = wp_get_attachment_image_src ($img_id,’fullsize’);
if ( !$full_src ) continue;
$file = get_post( $img_id );
$img_title = $file->post_title; // title
$img_caption = $file->post_excerpt; // caption
$img_desc = $file->post_content; // desctiprion
$img_alt = get_post_meta( $img_id, ‘_wp_attachment_image_alt’, true ); // alt
$thumb_src = wp_get_attachment_image_src ($img_id,’thumbnail’);
$slider .=
“t”.’

  • ‘.”n”.
    “tt”.’‘.”n”.
    “ttt”.”.”n”.
    ( $img_title ? “ttt”.”.$img_title.”.”n” : ” ).
    ( $img_desc ? “ttt”.”.wpautop( $img_caption ).”.”n” : ” ).
    “tt”.’
    ‘.”n”.
    “t”.’
  • ‘.”n”;
    endforeach;
    echo ‘

      ‘.”n”.$slider.’

    ‘.”n”;
    endif;
    ?>

    Attention

    The custom field doesn’t have multiple values, it just has become an array in a single value. When you call them with ‘get_post_meta’ function, do not set the third parameter to ‘false’.

    سوالات متداول

    پرسش و پاسخی برای این آیتم موجود نیست.
    ×
    نظری برای این آیتم موجود نیست.
    0 0 رای ها
    امتیازدهی
    اشتراک در
    اطلاع از
    0 نظرات
    قدیمی‌ترین
    تازه‌ترین بیشترین رأی
    بازخورد (Feedback) های اینلاین
    مشاهده همه دیدگاه ها
    نسخه حجم فایل SHA256 تغییرات دانلود
    1.4.1 308 کیلوبایت -
    دانلود
    ×
    ★★★★★
    ★★★★★
    5.0 /5 (2 نظر)

    قیمت:

    رایگان

    نگارش

    1.4.1

    آخرین انتشار

    18 اردیبهشت 1405

    آخرین بروزرسانی

    2 ماه پیش

    نصب های فعال

    400+

    نگارش وردپرس

    وردپرس 4.0+

    تست شده از نسخه

    وردپرس 4.7.33

    نگارش PHP

    -

    نسخه ها

    1 نسخه