diff --git src/wp-admin/custom-header.php src/wp-admin/custom-header.php
index 5cc64ef7bf..62c8e20108 100644
|
|
class Custom_Image_Header { |
42 | 42 | |
43 | 43 | /** |
44 | 44 | * Used to trigger a success message when settings updated and set to true. |
45 | | * |
| 45 | * |
46 | 46 | * @since 3.0.0 |
47 | 47 | * @access private |
48 | 48 | * @var bool |
… |
… |
wp_nonce_field( 'custom-header-options', '_wpnonce-custom-header-options' ); ?> |
1097 | 1097 | /** |
1098 | 1098 | * Calculate width and height based on what the currently selected theme supports. |
1099 | 1099 | * |
| 1100 | * @since 3.9.0 |
| 1101 | * |
1100 | 1102 | * @param array $dimensions |
1101 | 1103 | * @return array dst_height and dst_width of header image. |
1102 | 1104 | */ |
… |
… |
wp_nonce_field( 'custom-header-options', '_wpnonce-custom-header-options' ); ?> |
1147 | 1149 | /** |
1148 | 1150 | * Create an attachment 'object'. |
1149 | 1151 | * |
| 1152 | * @since 3.9.0 |
| 1153 | * |
1150 | 1154 | * @param string $cropped Cropped image URL. |
1151 | 1155 | * @param int $parent_attachment_id Attachment ID of parent image. |
1152 | | * |
1153 | 1156 | * @return array Attachment object. |
1154 | 1157 | */ |
1155 | 1158 | final public function create_attachment_object( $cropped, $parent_attachment_id ) { |
… |
… |
wp_nonce_field( 'custom-header-options', '_wpnonce-custom-header-options' ); ?> |
1174 | 1177 | /** |
1175 | 1178 | * Insert an attachment and its metadata. |
1176 | 1179 | * |
| 1180 | * @since 3.9.0 |
| 1181 | * |
1177 | 1182 | * @param array $object Attachment object. |
1178 | 1183 | * @param string $cropped Cropped image URL. |
1179 | | * |
1180 | 1184 | * @return int Attachment ID. |
1181 | 1185 | */ |
1182 | 1186 | final public function insert_attachment( $object, $cropped ) { |
… |
… |
wp_nonce_field( 'custom-header-options', '_wpnonce-custom-header-options' ); ?> |
1199 | 1203 | /** |
1200 | 1204 | * Gets attachment uploaded by Media Manager, crops it, then saves it as a |
1201 | 1205 | * new object. Returns JSON-encoded object details. |
| 1206 | * |
| 1207 | * @since 3.9.0 |
1202 | 1208 | */ |
1203 | 1209 | public function ajax_header_crop() { |
1204 | 1210 | check_ajax_referer( 'image_editor-' . $_POST['id'], 'nonce' ); |
… |
… |
wp_nonce_field( 'custom-header-options', '_wpnonce-custom-header-options' ); ?> |
1257 | 1263 | * |
1258 | 1264 | * Triggered when the user tries adds a new header image from the |
1259 | 1265 | * Media Manager, even if s/he doesn't save that change. |
| 1266 | * |
| 1267 | * @since 3.9.0 |
1260 | 1268 | */ |
1261 | 1269 | public function ajax_header_add() { |
1262 | 1270 | check_ajax_referer( 'header-add', 'nonce' ); |
… |
… |
wp_nonce_field( 'custom-header-options', '_wpnonce-custom-header-options' ); ?> |
1283 | 1291 | * |
1284 | 1292 | * Triggered when the user clicks the overlay "X" button next to each image |
1285 | 1293 | * choice in the Customizer's Header tool. |
| 1294 | * |
| 1295 | * @since 3.9.0 |
1286 | 1296 | */ |
1287 | 1297 | public function ajax_header_remove() { |
1288 | 1298 | check_ajax_referer( 'header-remove', 'nonce' ); |
… |
… |
wp_nonce_field( 'custom-header-options', '_wpnonce-custom-header-options' ); ?> |
1304 | 1314 | } |
1305 | 1315 | |
1306 | 1316 | /** |
| 1317 | * Updates the last-used postmeta on a header image attachment after saving a new header image via the customizer. |
1307 | 1318 | * |
1308 | | * @param WP_Customize_Manager $wp_customize |
| 1319 | * @since 3.9.0 |
| 1320 | * |
| 1321 | * @param WP_Customize_Manager $wp_customize Customize manager. |
1309 | 1322 | */ |
1310 | 1323 | public function customize_set_last_used( $wp_customize ) { |
1311 | 1324 | $data = $wp_customize->get_setting( 'header_image_data' )->post_value(); |
… |
… |
wp_nonce_field( 'custom-header-options', '_wpnonce-custom-header-options' ); ?> |
1320 | 1333 | } |
1321 | 1334 | |
1322 | 1335 | /** |
| 1336 | * Gets the details of default header images if defined. |
| 1337 | * |
| 1338 | * @since 3.9.0 |
1323 | 1339 | * |
1324 | | * @return array |
| 1340 | * @return array Default header images. |
1325 | 1341 | */ |
1326 | 1342 | public function get_default_header_images() { |
1327 | 1343 | $this->process_default_headers(); |
… |
… |
wp_nonce_field( 'custom-header-options', '_wpnonce-custom-header-options' ); ?> |
1360 | 1376 | } |
1361 | 1377 | |
1362 | 1378 | /** |
| 1379 | * Gets the previously uploaded header images. |
| 1380 | * |
| 1381 | * @since 3.9.0 |
1363 | 1382 | * |
1364 | | * @return array |
| 1383 | * @return array Uploaded header images. |
1365 | 1384 | */ |
1366 | 1385 | public function get_uploaded_header_images() { |
1367 | 1386 | $header_images = get_uploaded_header_images(); |