Changeset 33075
- Timestamp:
- 07/03/2015 09:27:06 PM (9 years ago)
- Location:
- trunk/src/wp-admin
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-site-icon.php
r33053 r33075 177 177 <p class="hide-if-no-js"> 178 178 <label class="screen-reader-text" for="choose-from-library-link"><?php _e( 'Choose an image from your media library:' ); ?></label> 179 <button type="button" id="choose-from-library-link" class="button" data- update-link="<?php echo esc_attr( $update_url ); ?>" data-choose="<?php esc_attr_e( 'Choose a Site Icon' ); ?>" data-update="<?php esc_attr_e( 'Set as Site Icon' ); ?>"><?php _e( 'Choose Image' ); ?></button>179 <button type="button" id="choose-from-library-link" class="button" data-size="<?php echo absint( $this->min_size ); ?>" data-update-link="<?php echo esc_attr( $update_url ); ?>" data-choose="<?php esc_attr_e( 'Choose a Site Icon' ); ?>" data-update="<?php esc_attr_e( 'Set as Site Icon' ); ?>"><?php _e( 'Choose Image' ); ?></button> 180 180 </p> 181 181 <form class="hide-if-js" action="<?php echo esc_url( admin_url( 'options-general.php?page=site-icon' ) ); ?>" method="post" enctype="multipart/form-data"> -
trunk/src/wp-admin/js/site-icon.js
r32994 r33075 4 4 $( function() { 5 5 // Build the choose from library frame. 6 $( '#choose-from-library-link' ). click(function( event ) {6 $( '#choose-from-library-link' ).on( 'click', function( event ) { 7 7 var $el = $(this); 8 8 event.preventDefault(); … … 15 15 16 16 // Create the media frame. 17 frame = wp.media.frames.customHeader = wp.media({ 18 // Set the title of the modal. 19 title: $el.data('choose'), 20 21 // Tell the modal to show only images. 22 library: { 23 type: 'image' 24 }, 25 17 frame = wp.media({ 26 18 // Customize the submit button. 27 19 button: { … … 31 23 // going to refresh the page when the image is selected. 32 24 close: false 33 } 25 }, 26 states: [ 27 new wp.media.controller.Library({ 28 title: $el.data( 'choose' ), 29 library: wp.media.query({ type: 'image' }), 30 date: false, 31 suggestedWidth: $el.data( 'size' ), 32 suggestedHeight: $el.data( 'size' ) 33 }) 34 ] 34 35 }); 35 36 -
trunk/src/wp-admin/options-general.php
r32994 r33075 147 147 <p class="hide-if-no-js"> 148 148 <label class="screen-reader-text" for="choose-from-library-link"><?php _e( 'Choose an image from your media library:' ); ?></label> 149 <button type="button" id="choose-from-library-link" class="button" data- update-link="<?php echo esc_attr( $update_url ); ?>" data-choose="<?php esc_attr_e( 'Choose a Site Icon' ); ?>" data-update="<?php esc_attr_e( 'Set as Site Icon' ); ?>"><?php _e( 'Update Site Icon' ); ?></button>149 <button type="button" id="choose-from-library-link" class="button" data-size="<?php echo absint( $GLOBALS['wp_site_icon']->min_size ); ?>" data-update-link="<?php echo esc_attr( $update_url ); ?>" data-choose="<?php esc_attr_e( 'Choose a Site Icon' ); ?>" data-update="<?php esc_attr_e( 'Set as Site Icon' ); ?>"><?php _e( 'Update Site Icon' ); ?></button> 150 150 <a href="<?php echo esc_url( $remove_url ); ?>"><?php _e( 'Remove Site Icon' ); ?></a> 151 151 </p> … … 159 159 <p class="hide-if-no-js"> 160 160 <label class="screen-reader-text" for="choose-from-library-link"><?php _e( 'Choose an image from your media library:' ); ?></label> 161 <button type="button" id="choose-from-library-link" class="button" data- update-link="<?php echo esc_attr( $update_url ); ?>" data-choose="<?php esc_attr_e( 'Choose a Site Icon' ); ?>" data-update="<?php esc_attr_e( 'Set as Site Icon' ); ?>"><?php _e( 'Choose Image' ); ?></button>161 <button type="button" id="choose-from-library-link" class="button" data-size="<?php echo absint( $GLOBALS['wp_site_icon']->min_size ); ?>" data-update-link="<?php echo esc_attr( $update_url ); ?>" data-choose="<?php esc_attr_e( 'Choose a Site Icon' ); ?>" data-update="<?php esc_attr_e( 'Set as Site Icon' ); ?>"><?php _e( 'Choose Image' ); ?></button> 162 162 </p> 163 163 <a class="button hide-if-js" href="<?php echo esc_url( $upload_url ); ?>"><?php _e( 'Add a Site Icon' ); ?></a>
Note: See TracChangeset
for help on using the changeset viewer.