PressThis:
- Remove unneeded passing of post formats strings to JS. - Set the currently selected post format name with jQuery. See #31373. Built from https://develop.svn.wordpress.org/trunk@31589 git-svn-id: http://core.svn.wordpress.org/trunk@31570 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
8ecb7f5d1e
commit
8164f8fe0e
|
@ -31,19 +31,10 @@ class WP_Press_This {
|
||||||
* @return array Site settings.
|
* @return array Site settings.
|
||||||
*/
|
*/
|
||||||
public function site_settings() {
|
public function site_settings() {
|
||||||
$supported_formats = get_theme_support( 'post-formats' );
|
|
||||||
$post_formats = array();
|
|
||||||
|
|
||||||
if ( ! empty( $supported_formats[0] ) && is_array( $supported_formats[0] ) ) {
|
|
||||||
$post_formats[0] = __( 'Standard' );
|
|
||||||
foreach ( $supported_formats[0] as $post_format ) {
|
|
||||||
$post_formats[ $post_format ] = esc_html( get_post_format_string( $post_format ) );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
'version' => 5,
|
// Used to trigger the bookmarklet update notice.
|
||||||
'post_formats' => $post_formats,
|
// Needs to be set here and in get_shortcut_link() in wp-includes/link-template.php.
|
||||||
|
'version' => '5',
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Filter whether or not Press This should redirect the user in the parent window upon save.
|
* Filter whether or not Press This should redirect the user in the parent window upon save.
|
||||||
|
|
|
@ -524,18 +524,6 @@
|
||||||
hasSetFocus = true;
|
hasSetFocus = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Adds the currently selected post format next to the option, in the options panel.
|
|
||||||
*
|
|
||||||
* @param format string Post format to be displayed
|
|
||||||
*/
|
|
||||||
function setPostFormatString( format ) {
|
|
||||||
if ( ! format || ! siteConfig || ! siteConfig.post_formats || ! siteConfig.post_formats[ format ] ) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
$( '#post-option-post-format' ).text( siteConfig.post_formats[ format ] );
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Save a new user-generated category via AJAX
|
* Save a new user-generated category via AJAX
|
||||||
*/
|
*/
|
||||||
|
@ -953,7 +941,7 @@
|
||||||
var $this = $( this );
|
var $this = $( this );
|
||||||
|
|
||||||
if ( $this.is( ':checked' ) ) {
|
if ( $this.is( ':checked' ) ) {
|
||||||
setPostFormatString( $this.attr( 'id' ).replace( /^post-format-(.+)$/, '$1' ) );
|
$( '#post-option-post-format' ).text( $( 'label[for="' + $this.attr( 'id' ) + '"]' ).text() || '' );
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
|
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -4,7 +4,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '4.2-alpha-31588';
|
$wp_version = '4.2-alpha-31589';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue