PressThis: make sure buttons.css is loaded before press-this.css. Use (int) $post_ID instead of $post->ID.

See #31373.

git-svn-id: https://develop.svn.wordpress.org/trunk@31597 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz 2015-03-02 00:57:34 +00:00
parent 2d19a3b446
commit 701d97b6d5
2 changed files with 4 additions and 4 deletions

View File

@ -723,10 +723,10 @@ class WP_Press_This {
$post = get_default_post_to_edit( 'post', true ); $post = get_default_post_to_edit( 'post', true );
$post_ID = (int) $post->ID; $post_ID = (int) $post->ID;
wp_enqueue_media( array( 'post' => $post_ID ) );
wp_enqueue_style( 'press-this' ); wp_enqueue_style( 'press-this' );
wp_enqueue_script( 'press-this' ); wp_enqueue_script( 'press-this' );
wp_enqueue_script( 'json2' ); wp_enqueue_script( 'json2' );
wp_enqueue_media( array( 'post' => $post->ID ) );
wp_enqueue_script( 'editor' ); wp_enqueue_script( 'editor' );
$supports_formats = false; $supports_formats = false;
@ -735,7 +735,7 @@ class WP_Press_This {
if ( current_theme_supports( 'post-formats' ) && post_type_supports( $post->post_type, 'post-formats' ) ) { if ( current_theme_supports( 'post-formats' ) && post_type_supports( $post->post_type, 'post-formats' ) ) {
$supports_formats = true; $supports_formats = true;
if ( ! ( $post_format = get_post_format( $post->ID ) ) ) { if ( ! ( $post_format = get_post_format( $post_ID ) ) ) {
$post_format = 0; $post_format = 0;
} }
} }
@ -794,7 +794,7 @@ $admin_body_classes = apply_filters( 'admin_body_class', '' );
</div> </div>
<form id="pressthis-form" name="pressthis-form" method="POST" autocomplete="off"> <form id="pressthis-form" name="pressthis-form" method="POST" autocomplete="off">
<input type="hidden" name="post_ID" id="post_ID" value="<?php echo esc_attr( $post_ID ); ?>" /> <input type="hidden" name="post_ID" id="post_ID" value="<?php echo $post_ID; ?>" />
<input type="hidden" name="action" value="press-this-save-post" /> <input type="hidden" name="action" value="press-this-save-post" />
<input type="hidden" name="post_status" id="post_status" value="draft" /> <input type="hidden" name="post_status" id="post_status" value="draft" />
<?php <?php

View File

@ -653,7 +653,7 @@ function wp_default_styles( &$styles ) {
$styles->add( 'wp-color-picker', "/wp-admin/css/color-picker$suffix.css" ); $styles->add( 'wp-color-picker', "/wp-admin/css/color-picker$suffix.css" );
$styles->add( 'customize-controls', "/wp-admin/css/customize-controls$suffix.css", array( 'wp-admin', 'colors', 'ie', 'imgareaselect' ) ); $styles->add( 'customize-controls', "/wp-admin/css/customize-controls$suffix.css", array( 'wp-admin', 'colors', 'ie', 'imgareaselect' ) );
$styles->add( 'customize-widgets', "/wp-admin/css/customize-widgets$suffix.css", array( 'wp-admin', 'colors' ) ); $styles->add( 'customize-widgets', "/wp-admin/css/customize-widgets$suffix.css", array( 'wp-admin', 'colors' ) );
$styles->add( 'press-this', "/wp-admin/css/press-this$suffix.css", array( 'open-sans' ) ); $styles->add( 'press-this', "/wp-admin/css/press-this$suffix.css", array( 'open-sans', 'buttons' ) );
$styles->add( 'ie', "/wp-admin/css/ie$suffix.css" ); $styles->add( 'ie', "/wp-admin/css/ie$suffix.css" );
$styles->add_data( 'ie', 'conditional', 'lte IE 7' ); $styles->add_data( 'ie', 'conditional', 'lte IE 7' );