Changeset 31589
- Timestamp:
- 02/28/2015 08:07:45 PM (10 years ago)
- Location:
- trunk/src/wp-admin
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-press-this.php
r31588 r31589 32 32 */ 33 33 public function site_settings() { 34 $supported_formats = get_theme_support( 'post-formats' );35 $post_formats = array();36 37 if ( ! empty( $supported_formats[0] ) && is_array( $supported_formats[0] ) ) {38 $post_formats[0] = __( 'Standard' );39 foreach ( $supported_formats[0] as $post_format ) {40 $post_formats[ $post_format ] = esc_html( get_post_format_string( $post_format ) );41 }42 }43 44 34 return array( 45 'version' => 5, 46 'post_formats' => $post_formats, 35 // Used to trigger the bookmarklet update notice. 36 // Needs to be set here and in get_shortcut_link() in wp-includes/link-template.php. 37 'version' => '5', 47 38 48 39 /** -
trunk/src/wp-admin/js/press-this.js
r31566 r31589 526 526 527 527 /** 528 * Adds the currently selected post format next to the option, in the options panel.529 *530 * @param format string Post format to be displayed531 */532 function setPostFormatString( format ) {533 if ( ! format || ! siteConfig || ! siteConfig.post_formats || ! siteConfig.post_formats[ format ] ) {534 return;535 }536 $( '#post-option-post-format' ).text( siteConfig.post_formats[ format ] );537 }538 539 /**540 528 * Save a new user-generated category via AJAX 541 529 */ … … 954 942 955 943 if ( $this.is( ':checked' ) ) { 956 setPostFormatString( $this.attr( 'id' ).replace( /^post-format-(.+)$/, '$1' ));944 $( '#post-option-post-format' ).text( $( 'label[for="' + $this.attr( 'id' ) + '"]' ).text() || '' ); 957 945 } 958 946 } );
Note: See TracChangeset
for help on using the changeset viewer.