Docs: Fix placement of some duplicate hook references.

Hook documentation should be on the line directly above the line containing the `do_action()` or `apply_filters()` call. The CS auto-fixing, which changed some inconsistent function calls to multi-line function calls, is part of the reason why this was no longer the case for a select group of duplicate hook references.

Includes minor code layout fixes.

See #47110.
Built from https://develop.svn.wordpress.org/trunk@46088


git-svn-id: http://core.svn.wordpress.org/trunk@45900 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov
2019-09-10 19:23:55 +00:00
parent c9071ca2e6
commit dcb08f0637
15 changed files with 310 additions and 197 deletions

View File

@@ -584,9 +584,11 @@ class Custom_Background {
if ( ! current_user_can( 'edit_theme_options' ) || ! isset( $_POST['attachment_id'] ) ) {
exit;
}
$attachment_id = absint( $_POST['attachment_id'] );
/** This filter is documented in wp-admin/includes/media.php */
$sizes = array_keys(
/** This filter is documented in wp-admin/includes/media.php */
apply_filters(
'image_size_names_choose',
array(
@@ -597,12 +599,14 @@ class Custom_Background {
)
)
);
$size = 'thumbnail';
$size = 'thumbnail';
if ( in_array( $_POST['size'], $sizes ) ) {
$size = esc_attr( $_POST['size'] );
}
update_post_meta( $attachment_id, '_wp_attachment_is_custom_background', get_option( 'stylesheet' ) );
$url = wp_get_attachment_image_src( $attachment_id, $size );
$thumbnail = wp_get_attachment_image_src( $attachment_id, 'thumbnail' );
set_theme_mod( 'background_image', esc_url_raw( $url[0] ) );