Changeset 527699
- Timestamp:
- 04/05/2012 03:54:07 PM (14 years ago)
- Location:
- extend-upload
- Files:
-
- 1 deleted
- 1 edited
-
tags/0.0.2 (deleted)
-
trunk/readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
extend-upload/trunk/readme.txt
r527691 r527699 15 15 To use you must enqueue in the page used both the style and the script of the plugin: 16 16 ` 17 <?php18 wp_enqueue_script( 'extend-upload' );19 wp_enqueue_style( 'extend-upload' );17 <?php 18 wp_enqueue_script( 'extend-upload' ); 19 wp_enqueue_style( 'extend-upload' ); 20 20 ` 21 21 22 22 Then you can use the plugin by calling the jQuery Extends: 23 23 ` 24 (function($) {25 $(document).ready(function () {26 $('.uc-call').callUpload();27 });28 })(jQuery.noConflict());24 (function($) { 25 $(document).ready(function () { 26 $('.uc-call').callUpload(); 27 }); 28 })(jQuery.noConflict()); 29 29 ` 30 30 And the HTML/PHP output should be something like that: 31 31 ` 32 <?php 33 $args = array( 34 'url' => admin_url( 'media-upload.php?post_id=0&button=' . rawurlencode('Use as Avatar') . '&TB_iframe=1&width=640&height=253' ) 35 ) 36 ?> 37 <p class='uc-container'> 38 <label><?php echo _e( "Avatar:" ); ?></label><a target='_blank' class='uc-call' data='<?php echo json_encode( $args ); ?>'><small>" . __( "Upload the Photo" ) . "</small></a>"; ?> 39 <input class="uc-answer" type="text" value="<?php echo ( is_numeric( absint( $avatar ) ) ? absint( $avatar ) : esc_url($avatar) ); ?>" /> 40 </p> 32 <?php 33 $args = array( 34 'url' => admin_url( 'media-upload.php?post_id=0&button=' . rawurlencode('Use as Avatar') . '&TB_iframe=1&width=640&height=253' ) 35 ); 36 ?> 37 <p class='uc-container'> 38 <label><?php echo _e( "Avatar:" ); ?></label><a target='_blank' class='uc-call' data='<?php echo json_encode( $args ); ?>'><small>" . __( "Upload the Photo" ) . "</small></a>"; ?> 39 <input class="uc-answer" type="text" value="<?php echo ( is_numeric( absint( $avatar ) ) ? absint( $avatar ) : esc_url($avatar) ); ?>" /> 40 </p> 41 ` 41 42 42 `43 43 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. 44 44
Note: See TracChangeset
for help on using the changeset viewer.