WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )apply_filters( "hook_name", "what_to_filter" ).Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
This hook occurs 2 times in this file.
| Line | Code |
|---|---|
| 1483 | |
| 1484 | /** |
| 1485 | * Filters the attachment fields to edit. |
| 1486 | * |
| 1487 | * @since 2.5.0 |
| 1488 | * |
| 1489 | * @param array $form_fields An array of attachment form fields. |
| 1490 | * @param WP_Post $post The WP_Post attachment object. |
| 1491 | */ |
| 1492 | $form_fields = apply_filters( 'attachment_fields_to_edit', $form_fields, $post ); |
| 1493 | |
| 1494 | return $form_fields; |
| 1495 | } |
| 1496 | |
| 1497 | /** |
| 1498 | * Retrieves HTML for media items of post gallery. |
| 1499 | * |
| 1500 | * The HTML markup retrieved will be created for the progress of SWF Upload |
| 1501 | * component. Will also create link for showing and hiding the form to modify |
| Line | Code |
| 1909 | /* |
| 1910 | * Merge default fields with their errors, so any key passed with the error |
| 1911 | * (e.g. 'error', 'helps', 'value') will replace the default. |
| 1912 | * The recursive merge is easily traversed with array casting: |
| 1913 | * foreach ( (array) $things as $thing ) |
| 1914 | */ |
| 1915 | $form_fields = array_merge_recursive( $form_fields, (array) $args['errors'] ); |
| 1916 | |
| 1917 | /** This filter is documented in wp-admin/includes/media.php */ |
| 1918 | $form_fields = apply_filters( 'attachment_fields_to_edit', $form_fields, $post ); |
| 1919 | |
| 1920 | unset( |
| 1921 | $form_fields['image-size'], |
| 1922 | $form_fields['align'], |
| 1923 | $form_fields['image_alt'], |
| 1924 | $form_fields['post_title'], |
| 1925 | $form_fields['post_excerpt'], |
| 1926 | $form_fields['post_content'], |
| 1927 | $form_fields['url'], |