Ticket #17262: 17262.9.diff
File 17262.9.diff, 22.2 KB (added by , 23 months ago) |
---|
-
src/js/_enqueues/wp/widgets/custom-html.js
diff --git a/src/js/_enqueues/wp/widgets/custom-html.js b/src/js/_enqueues/wp/widgets/custom-html.js index 93aa901c2f..6cc4835eeb 100644
a b wp.customHtmlWidgets = ( function( $ ) { 115 115 control.contentUpdateBypassed = control.fields.content.is( document.activeElement ) || control.editor && control.editor.codemirror.state.focused || 0 !== control.currentErrorAnnotations.length; 116 116 if ( ! control.contentUpdateBypassed ) { 117 117 syncInput = control.syncContainer.find( '.sync-input.content' ); 118 control.fields.content.val( syncInput.val() ) ;118 control.fields.content.val( syncInput.val() ).trigger( 'change' ); 119 119 } 120 120 }, 121 121 -
src/wp-admin/includes/dashboard.php
diff --git a/src/wp-admin/includes/dashboard.php b/src/wp-admin/includes/dashboard.php index cf13fcfc24..e3e8cca9a7 100644
a b function wp_dashboard_php_nag() { 1647 1647 <?php 1648 1648 1649 1649 wp_update_php_annotation(); 1650 wp_direct_php_update_button();1651 1650 } 1652 1651 1653 1652 /** -
src/wp-content/themes/twentynineteen/sass/blocks/_blocks.scss
diff --git a/src/wp-content/themes/twentynineteen/sass/blocks/_blocks.scss b/src/wp-content/themes/twentynineteen/sass/blocks/_blocks.scss index 653e50a8c2..479ee33d25 100644
a b 838 838 // Use white text against these backgrounds by default. 839 839 color: $color__background-body; 840 840 841 >p,842 >h1,843 >h2,844 >h3,845 >h4,846 >h5,847 >h6,848 >a {841 p, 842 h1, 843 h2, 844 h3, 845 h4, 846 h5, 847 h6, 848 a { 849 849 color: $color__background-body; 850 850 } 851 851 } … … 854 854 color: $color__text-main; 855 855 856 856 // Use dark gray text against this background by default. 857 >p,858 >h1,859 >h2,860 >h3,861 >h4,862 >h5,863 >h6,864 >a {857 p, 858 h1, 859 h2, 860 h3, 861 h4, 862 h5, 863 h6, 864 a { 865 865 color: $color__text-main; 866 866 } 867 867 } … … 894 894 //! Custom foreground colors 895 895 .has-primary-color, 896 896 .wp-block-pullquote.is-style-solid-color blockquote.has-primary-color, 897 .wp-block-pullquote.is-style-solid-color blockquote.has-primary-color >p {897 .wp-block-pullquote.is-style-solid-color blockquote.has-primary-color p { 898 898 color: $color__link; 899 899 } 900 900 901 901 .has-secondary-color, 902 902 .wp-block-pullquote.is-style-solid-color blockquote.has-secondary-color, 903 .wp-block-pullquote.is-style-solid-color blockquote.has-secondary-color >p {903 .wp-block-pullquote.is-style-solid-color blockquote.has-secondary-color p { 904 904 color: $color__border-link-hover; 905 905 } 906 906 907 907 .has-dark-gray-color, 908 908 .wp-block-pullquote.is-style-solid-color blockquote.has-dark-gray-color, 909 .wp-block-pullquote.is-style-solid-color blockquote.has-dark-gray-color >p {909 .wp-block-pullquote.is-style-solid-color blockquote.has-dark-gray-color p { 910 910 color: $color__text-main; 911 911 } 912 912 913 913 .has-light-gray-color, 914 914 .wp-block-pullquote.is-style-solid-color blockquote.has-light-gray-color, 915 .wp-block-pullquote.is-style-solid-color blockquote.has-light-gray-color >p {915 .wp-block-pullquote.is-style-solid-color blockquote.has-light-gray-color p { 916 916 color: $color__text-light; 917 917 } 918 918 -
src/wp-content/themes/twentynineteen/style-rtl.css
diff --git a/src/wp-content/themes/twentynineteen/style-rtl.css b/src/wp-content/themes/twentynineteen/style-rtl.css index 3fd6f91ecd..80732eb901 100644
a b body.page .main-navigation { 6075 6075 color: #fff; 6076 6076 } 6077 6077 6078 .entry .entry-content .has-primary-background-color >p,6079 .entry .entry-content .has-primary-background-color >h1,6080 .entry .entry-content .has-primary-background-color >h2,6081 .entry .entry-content .has-primary-background-color >h3,6082 .entry .entry-content .has-primary-background-color >h4,6083 .entry .entry-content .has-primary-background-color >h5,6084 .entry .entry-content .has-primary-background-color >h6,6085 .entry .entry-content .has-primary-background-color >a,6086 .entry .entry-content .has-secondary-background-color >p,6087 .entry .entry-content .has-secondary-background-color >h1,6088 .entry .entry-content .has-secondary-background-color >h2,6089 .entry .entry-content .has-secondary-background-color >h3,6090 .entry .entry-content .has-secondary-background-color >h4,6091 .entry .entry-content .has-secondary-background-color >h5,6092 .entry .entry-content .has-secondary-background-color >h6,6093 .entry .entry-content .has-secondary-background-color >a,6094 .entry .entry-content .has-dark-gray-background-color >p,6095 .entry .entry-content .has-dark-gray-background-color >h1,6096 .entry .entry-content .has-dark-gray-background-color >h2,6097 .entry .entry-content .has-dark-gray-background-color >h3,6098 .entry .entry-content .has-dark-gray-background-color >h4,6099 .entry .entry-content .has-dark-gray-background-color >h5,6100 .entry .entry-content .has-dark-gray-background-color >h6,6101 .entry .entry-content .has-dark-gray-background-color >a,6102 .entry .entry-content .has-light-gray-background-color >p,6103 .entry .entry-content .has-light-gray-background-color >h1,6104 .entry .entry-content .has-light-gray-background-color >h2,6105 .entry .entry-content .has-light-gray-background-color >h3,6106 .entry .entry-content .has-light-gray-background-color >h4,6107 .entry .entry-content .has-light-gray-background-color >h5,6108 .entry .entry-content .has-light-gray-background-color >h6,6109 .entry .entry-content .has-light-gray-background-color >a {6078 .entry .entry-content .has-primary-background-color p, 6079 .entry .entry-content .has-primary-background-color h1, 6080 .entry .entry-content .has-primary-background-color h2, 6081 .entry .entry-content .has-primary-background-color h3, 6082 .entry .entry-content .has-primary-background-color h4, 6083 .entry .entry-content .has-primary-background-color h5, 6084 .entry .entry-content .has-primary-background-color h6, 6085 .entry .entry-content .has-primary-background-color a, 6086 .entry .entry-content .has-secondary-background-color p, 6087 .entry .entry-content .has-secondary-background-color h1, 6088 .entry .entry-content .has-secondary-background-color h2, 6089 .entry .entry-content .has-secondary-background-color h3, 6090 .entry .entry-content .has-secondary-background-color h4, 6091 .entry .entry-content .has-secondary-background-color h5, 6092 .entry .entry-content .has-secondary-background-color h6, 6093 .entry .entry-content .has-secondary-background-color a, 6094 .entry .entry-content .has-dark-gray-background-color p, 6095 .entry .entry-content .has-dark-gray-background-color h1, 6096 .entry .entry-content .has-dark-gray-background-color h2, 6097 .entry .entry-content .has-dark-gray-background-color h3, 6098 .entry .entry-content .has-dark-gray-background-color h4, 6099 .entry .entry-content .has-dark-gray-background-color h5, 6100 .entry .entry-content .has-dark-gray-background-color h6, 6101 .entry .entry-content .has-dark-gray-background-color a, 6102 .entry .entry-content .has-light-gray-background-color p, 6103 .entry .entry-content .has-light-gray-background-color h1, 6104 .entry .entry-content .has-light-gray-background-color h2, 6105 .entry .entry-content .has-light-gray-background-color h3, 6106 .entry .entry-content .has-light-gray-background-color h4, 6107 .entry .entry-content .has-light-gray-background-color h5, 6108 .entry .entry-content .has-light-gray-background-color h6, 6109 .entry .entry-content .has-light-gray-background-color a { 6110 6110 color: #fff; 6111 6111 } 6112 6112 … … body.page .main-navigation { 6114 6114 color: #111; 6115 6115 } 6116 6116 6117 .entry .entry-content .has-white-background-color >p,6118 .entry .entry-content .has-white-background-color >h1,6119 .entry .entry-content .has-white-background-color >h2,6120 .entry .entry-content .has-white-background-color >h3,6121 .entry .entry-content .has-white-background-color >h4,6122 .entry .entry-content .has-white-background-color >h5,6123 .entry .entry-content .has-white-background-color >h6,6124 .entry .entry-content .has-white-background-color >a {6117 .entry .entry-content .has-white-background-color p, 6118 .entry .entry-content .has-white-background-color h1, 6119 .entry .entry-content .has-white-background-color h2, 6120 .entry .entry-content .has-white-background-color h3, 6121 .entry .entry-content .has-white-background-color h4, 6122 .entry .entry-content .has-white-background-color h5, 6123 .entry .entry-content .has-white-background-color h6, 6124 .entry .entry-content .has-white-background-color a { 6125 6125 color: #111; 6126 6126 } 6127 6127 … … body.page .main-navigation { 6152 6152 6153 6153 .entry .entry-content .has-primary-color, 6154 6154 .entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-primary-color, 6155 .entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-primary-color >p {6155 .entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-primary-color p { 6156 6156 color: #0073aa; 6157 6157 } 6158 6158 6159 6159 .entry .entry-content .has-secondary-color, 6160 6160 .entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-secondary-color, 6161 .entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-secondary-color >p {6161 .entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-secondary-color p { 6162 6162 color: #005177; 6163 6163 } 6164 6164 6165 6165 .entry .entry-content .has-dark-gray-color, 6166 6166 .entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-dark-gray-color, 6167 .entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-dark-gray-color >p {6167 .entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-dark-gray-color p { 6168 6168 color: #111; 6169 6169 } 6170 6170 6171 6171 .entry .entry-content .has-light-gray-color, 6172 6172 .entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-light-gray-color, 6173 .entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-light-gray-color >p {6173 .entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-light-gray-color p { 6174 6174 color: #767676; 6175 6175 } 6176 6176 -
src/wp-content/themes/twentynineteen/style.css
diff --git a/src/wp-content/themes/twentynineteen/style.css b/src/wp-content/themes/twentynineteen/style.css index ac596fab23..0185b404e5 100644
a b body.page .main-navigation { 6087 6087 color: #fff; 6088 6088 } 6089 6089 6090 .entry .entry-content .has-primary-background-color >p,6091 .entry .entry-content .has-primary-background-color >h1,6092 .entry .entry-content .has-primary-background-color >h2,6093 .entry .entry-content .has-primary-background-color >h3,6094 .entry .entry-content .has-primary-background-color >h4,6095 .entry .entry-content .has-primary-background-color >h5,6096 .entry .entry-content .has-primary-background-color >h6,6097 .entry .entry-content .has-primary-background-color >a,6098 .entry .entry-content .has-secondary-background-color >p,6099 .entry .entry-content .has-secondary-background-color >h1,6100 .entry .entry-content .has-secondary-background-color >h2,6101 .entry .entry-content .has-secondary-background-color >h3,6102 .entry .entry-content .has-secondary-background-color >h4,6103 .entry .entry-content .has-secondary-background-color >h5,6104 .entry .entry-content .has-secondary-background-color >h6,6105 .entry .entry-content .has-secondary-background-color >a,6106 .entry .entry-content .has-dark-gray-background-color >p,6107 .entry .entry-content .has-dark-gray-background-color >h1,6108 .entry .entry-content .has-dark-gray-background-color >h2,6109 .entry .entry-content .has-dark-gray-background-color >h3,6110 .entry .entry-content .has-dark-gray-background-color >h4,6111 .entry .entry-content .has-dark-gray-background-color >h5,6112 .entry .entry-content .has-dark-gray-background-color >h6,6113 .entry .entry-content .has-dark-gray-background-color >a,6114 .entry .entry-content .has-light-gray-background-color >p,6115 .entry .entry-content .has-light-gray-background-color >h1,6116 .entry .entry-content .has-light-gray-background-color >h2,6117 .entry .entry-content .has-light-gray-background-color >h3,6118 .entry .entry-content .has-light-gray-background-color >h4,6119 .entry .entry-content .has-light-gray-background-color >h5,6120 .entry .entry-content .has-light-gray-background-color >h6,6121 .entry .entry-content .has-light-gray-background-color >a {6090 .entry .entry-content .has-primary-background-color p, 6091 .entry .entry-content .has-primary-background-color h1, 6092 .entry .entry-content .has-primary-background-color h2, 6093 .entry .entry-content .has-primary-background-color h3, 6094 .entry .entry-content .has-primary-background-color h4, 6095 .entry .entry-content .has-primary-background-color h5, 6096 .entry .entry-content .has-primary-background-color h6, 6097 .entry .entry-content .has-primary-background-color a, 6098 .entry .entry-content .has-secondary-background-color p, 6099 .entry .entry-content .has-secondary-background-color h1, 6100 .entry .entry-content .has-secondary-background-color h2, 6101 .entry .entry-content .has-secondary-background-color h3, 6102 .entry .entry-content .has-secondary-background-color h4, 6103 .entry .entry-content .has-secondary-background-color h5, 6104 .entry .entry-content .has-secondary-background-color h6, 6105 .entry .entry-content .has-secondary-background-color a, 6106 .entry .entry-content .has-dark-gray-background-color p, 6107 .entry .entry-content .has-dark-gray-background-color h1, 6108 .entry .entry-content .has-dark-gray-background-color h2, 6109 .entry .entry-content .has-dark-gray-background-color h3, 6110 .entry .entry-content .has-dark-gray-background-color h4, 6111 .entry .entry-content .has-dark-gray-background-color h5, 6112 .entry .entry-content .has-dark-gray-background-color h6, 6113 .entry .entry-content .has-dark-gray-background-color a, 6114 .entry .entry-content .has-light-gray-background-color p, 6115 .entry .entry-content .has-light-gray-background-color h1, 6116 .entry .entry-content .has-light-gray-background-color h2, 6117 .entry .entry-content .has-light-gray-background-color h3, 6118 .entry .entry-content .has-light-gray-background-color h4, 6119 .entry .entry-content .has-light-gray-background-color h5, 6120 .entry .entry-content .has-light-gray-background-color h6, 6121 .entry .entry-content .has-light-gray-background-color a { 6122 6122 color: #fff; 6123 6123 } 6124 6124 … … body.page .main-navigation { 6126 6126 color: #111; 6127 6127 } 6128 6128 6129 .entry .entry-content .has-white-background-color >p,6130 .entry .entry-content .has-white-background-color >h1,6131 .entry .entry-content .has-white-background-color >h2,6132 .entry .entry-content .has-white-background-color >h3,6133 .entry .entry-content .has-white-background-color >h4,6134 .entry .entry-content .has-white-background-color >h5,6135 .entry .entry-content .has-white-background-color >h6,6136 .entry .entry-content .has-white-background-color >a {6129 .entry .entry-content .has-white-background-color p, 6130 .entry .entry-content .has-white-background-color h1, 6131 .entry .entry-content .has-white-background-color h2, 6132 .entry .entry-content .has-white-background-color h3, 6133 .entry .entry-content .has-white-background-color h4, 6134 .entry .entry-content .has-white-background-color h5, 6135 .entry .entry-content .has-white-background-color h6, 6136 .entry .entry-content .has-white-background-color a { 6137 6137 color: #111; 6138 6138 } 6139 6139 … … body.page .main-navigation { 6164 6164 6165 6165 .entry .entry-content .has-primary-color, 6166 6166 .entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-primary-color, 6167 .entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-primary-color >p {6167 .entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-primary-color p { 6168 6168 color: #0073aa; 6169 6169 } 6170 6170 6171 6171 .entry .entry-content .has-secondary-color, 6172 6172 .entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-secondary-color, 6173 .entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-secondary-color >p {6173 .entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-secondary-color p { 6174 6174 color: #005177; 6175 6175 } 6176 6176 6177 6177 .entry .entry-content .has-dark-gray-color, 6178 6178 .entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-dark-gray-color, 6179 .entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-dark-gray-color >p {6179 .entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-dark-gray-color p { 6180 6180 color: #111; 6181 6181 } 6182 6182 6183 6183 .entry .entry-content .has-light-gray-color, 6184 6184 .entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-light-gray-color, 6185 .entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-light-gray-color >p {6185 .entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-light-gray-color p { 6186 6186 color: #767676; 6187 6187 } 6188 6188 -
src/wp-includes/functions.php
diff --git a/src/wp-includes/functions.php b/src/wp-includes/functions.php index 2cce881518..397acd3a42 100644
a b function wp_update_php_annotation() { 6830 6830 ); 6831 6831 echo'</p>'; 6832 6832 } 6833 6834 /**6835 * Gets the URL for directly updating the PHP version the site is running on.6836 *6837 * A URL will only be returned if the `WP_DIRECT_UPDATE_PHP_URL` environment variable is specified or6838 * by using the {@see 'wp_direct_php_update_url'} filter. This allows hosts to send users directly to6839 * the page where they can update PHP to a newer version.6840 *6841 * @return string URL for directly updating PHP or empty string.6842 */6843 function wp_get_direct_php_update_url() {6844 $direct_update_url = '';6845 6846 if ( false !== getenv( 'WP_DIRECT_UPDATE_PHP_URL' ) ) {6847 $direct_update_url = getenv( 'WP_DIRECT_UPDATE_PHP_URL' );6848 }6849 6850 /**6851 * Filters the URL for directly updating the PHP version the site is running on from the host.6852 *6853 * @since 5.1.16854 *6855 * @param string $direct_update_url URL for directly updating PHP.6856 */6857 $direct_update_url = apply_filters( 'wp_direct_php_update_url', $direct_update_url );6858 6859 return $direct_update_url;6860 }6861 6862 /**6863 * Display a button directly linking to a PHP update process.6864 *6865 * This provides hosts with a way for users to be sent directly to their PHP update process.6866 *6867 * The button is only displayed if a URL is returned by `wp_get_direct_php_update_url()`.6868 *6869 * @since 5.1.16870 */6871 function wp_direct_php_update_button() {6872 $direct_update_url = wp_get_direct_php_update_url();6873 6874 if ( empty( $direct_update_url ) ) {6875 return;6876 }6877 6878 echo '<p class="button-container">';6879 printf(6880 '<a class="button button-primary" href="%1$s" target="_blank" rel="noopener noreferrer">%2$s <span class="screen-reader-text">%3$s</span><span aria-hidden="true" class="dashicons dashicons-external"></span></a>',6881 esc_url( $direct_update_url ),6882 __( 'Update PHP' ),6883 /* translators: accessibility text */6884 __( '(opens in a new tab)' )6885 );6886 echo '</p>';6887 } -
src/wp-includes/media.php
diff --git a/src/wp-includes/media.php b/src/wp-includes/media.php index 019086c3b8..ecac41b7a2 100644
a b function wp_get_attachment_image_url( $attachment_id, $size = 'thumbnail', $icon 945 945 return isset( $image['0'] ) ? $image['0'] : false; 946 946 } 947 947 948 /** 949 * Get the size path of an image attachment. 950 * 951 * @param int $attachment_id Attachment ID. 952 * @param string|array $size Optional. Image size to retrieve. Accepts any valid image size, or an array 953 * of width and height values. Default 'thumbnail' 954 * 955 * @return string|null Attachment path or null if no image is available. 956 */ 957 function wp_get_attachment_image_file( $attachment_id, $size = 'thumbnail' ) { 958 959 if ( 0 === (int) $attachment_id ) { 960 return null; 961 } 962 963 $attachment_metadata = wp_get_attachment_metadata( $attachment_id ); 964 965 if ( ! $attachment_metadata ) { 966 return null; 967 } 968 969 $file_name = isset( $attachment_metadata['sizes'][ $size ]['file'] ) ? $attachment_metadata['sizes'][ $size ]['file'] : false; 970 971 $file = dirname( $attachment_metadata['file'] ) . '/' . $file_name; 972 973 $file_path = _wp_get_attachment_relative_path( $file ); 974 975 if ( empty( $file_path ) ) { 976 return null; 977 } 978 979 $wp_upload_dir = wp_upload_dir( null, null ); 980 981 $path = $wp_upload_dir['basedir'] . '/' . trailingslashit( $file_path ) . $file_name; 982 983 return $path; 984 985 } 986 987 948 988 /** 949 989 * Get the attachment path relative to the upload directory. 950 990 * -
src/wp-includes/post.php
diff --git a/src/wp-includes/post.php b/src/wp-includes/post.php index eb69ac727b..5250aaa294 100644
a b function wp_get_attachment_caption( $post_id = 0 ) { 5689 5689 * Retrieve thumbnail for an attachment. 5690 5690 * 5691 5691 * @since 2.1.0 5692 * @deprecated 5.2 Use wp_get_attachment_image_file( $attachment_id, $size = 'thumbnail' ) 5692 5693 * 5693 5694 * @param int $post_id Optional. Attachment ID. Default 0. 5694 5695 * @return string|false False on failure. Thumbnail file path on success. -
new file tests/phpunit/tests/media/getImageAttachmentSize.php
diff --git a/tests/phpunit/tests/media/getImageAttachmentSize.php b/tests/phpunit/tests/media/getImageAttachmentSize.php new file mode 100644 index 0000000000..37f2162f53
- + 1 <?php 2 3 /** 4 * @group media 5 */ 6 class Tests_Media_GetImageAttachmentSize extends WP_UnitTestCase { 7 8 /** @var array WP Upload Dir. */ 9 protected $wp_upload_dir; 10 11 public function setUp() { 12 $this->wp_upload_dir = wp_upload_dir(); 13 14 parent::setUp(); 15 } 16 17 /** 18 * Creating file. 19 * 20 * @param string $file_name Image file name. 21 * 22 * @return int Attachment ID. 23 */ 24 protected function upload_image( $file_name ) { 25 $post_id = self::factory()->post->create( [ 'post_author' => 1 ] ); 26 27 \copy( DIR_TESTDATA . '/images/' . $file_name, $this->wp_upload_dir['path'] . '/' . $file_name ); 28 29 $file = $this->wp_upload_dir['path'] . '/' . $file_name; 30 31 $wp_filetype = wp_check_filetype( basename( $file ), null ); 32 33 $attachment_id = wp_insert_attachment( 34 [ 35 'post_mime_type' => $wp_filetype['type'], 36 'post_status' => 'inherit', 37 'post_title' => preg_replace( '/\.[^.]+$/', '', basename( $file ) ), 38 'post_content' => '', 39 ], 40 $file, 41 $post_id 42 ); 43 44 $attachment_data = wp_generate_attachment_metadata( $attachment_id, $file ); 45 46 wp_update_attachment_metadata( $attachment_id, $attachment_data, $post_id ); 47 48 return $attachment_id; 49 } 50 51 public function test_get_attachment_image_size() { 52 $attachment_id = $this->upload_image( 'waffles.jpg' ); 53 54 $file_size = wp_get_attachment_image_file( $attachment_id, 'medium' ); 55 56 $this->assertContains( 'waffles-300x200.jpg', $file_size ); 57 } 58 59 public function test_get_custom_attachment_image_size() { 60 add_image_size( 'custom', 400, 400, true ); 61 62 $attachment_id = $this->upload_image( 'canola.jpg' ); 63 64 $file_size = wp_get_attachment_image_file( $attachment_id, 'custom' ); 65 66 $this->assertContains( 'canola-400x400.jpg', $file_size ); 67 } 68 }