plugin-icon

Extend Upload

제작자: Gustavo Bordoni·
A plugin for developers to Extend WordPress upload to be able to use it at any place.
버전
0.0.4
최근 업데이트일
Mar 15, 2013

I had a problem that most of the time I had to upload a file, and I had to use a HTML upload, and that’s kind of bad, so I created something to use the Thickbox and the WordPress Uploader.

To use you must enqueue in the page used both the style and the script of the plugin:

<?php wp_enqueue_script( 'extend-upload' ); wp_enqueue_style( 'extend-upload' );

Then you can use the plugin by calling the jQuery Extends:

(function($) { $(document).ready(function () { $('.uc-call').callUpload(); }); })(jQuery.noConflict());

And the HTML/PHP output should be something like that:

<?php $args = array( 'url' => admin_url( 'media-upload.php?post_id=0&button=' . rawurlencode('Use as Avatar') . '&TB_iframe=1&width=640&height=253' ) ); ?> <p class='uc-container'> <label><?php echo _e( "Avatar:" ); ?></label><a target='_blank' class='uc-call' data='<?php echo json_encode( $args ); ?>'><small><?php _e( "Upload the Photo" ); ?></small></a>"; ?> <input class="uc-answer" type="text" value="<?php echo ( is_numeric( absint( $avatar ) ) ? absint( $avatar ) : esc_url($avatar) ); ?>" /> </p>

Having the uc-call for the link, uc-answer with the input field and uc-container for the box with both the link and the input field.

All the stuff is customizable by passing the variables in to the array $args, some stuff must be passed in the url, but later on I will add a easier way to do it.

Backlog

0.0.4

  • Older version of jQuery allowed and allowing non Image Media to be used

0.0.3

  • Fixed some bugs and added internationalization

0.0.2

  • Added the javascript to change the Insert to Post text on the thickbox

0.0.1

  • Using the the thickbox with the uploader iFrame inside you can call this from any page that has the script enqueued
무료유료 요금제에서
설치하면 WordPress.com 서비스 약관서드파티 플러그인 약관에 동의하게 됩니다.
테스트된 버전
WordPress 3.5.2
이 플러그인은 다운로드할 수 있으며 에서 사용할 수 있습니다.