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 3 times in this file.
| Line | Code |
|---|---|
| 1670 | |
| 1671 | /** |
| 1672 | * Filters the media metadata. |
| 1673 | * |
| 1674 | * @since 2.5.0 |
| 1675 | * |
| 1676 | * @param string $media_dims The HTML markup containing the media dimensions. |
| 1677 | * @param WP_Post $post The WP_Post attachment object. |
| 1678 | */ |
| 1679 | $media_dims = apply_filters( 'media_meta', $media_dims, $post ); |
| 1680 | |
| 1681 | $image_edit_button = ''; |
| 1682 | |
| 1683 | if ( wp_attachment_is_image( $post->ID ) && wp_image_editor_supports( array( 'mime_type' => $post->post_mime_type ) ) ) { |
| 1684 | $nonce = wp_create_nonce( "image_editor-$post->ID" ); |
| 1685 | $image_edit_button = "<input type='button' id='imgedit-open-btn-$post->ID' onclick='imageEdit.open( $post->ID, \"$nonce\" )' class='button' value='" . esc_attr__( 'Edit Image' ) . "' /> <span class='spinner'></span>"; |
| 1686 | } |
| 1687 | |
| 1688 | $attachment_url = get_permalink( $attachment_id ); |
| Line | Code |
| 1941 | $form_fields['post_title'], |
| 1942 | $form_fields['post_excerpt'], |
| 1943 | $form_fields['post_content'], |
| 1944 | $form_fields['url'], |
| 1945 | $form_fields['menu_order'], |
| 1946 | $form_fields['image_url'] |
| 1947 | ); |
| 1948 | |
| 1949 | /** This filter is documented in wp-admin/includes/media.php */ |
| 1950 | $media_meta = apply_filters( 'media_meta', '', $post ); |
| 1951 | |
| 1952 | $defaults = array( |
| 1953 | 'input' => 'text', |
| 1954 | 'required' => false, |
| 1955 | 'value' => '', |
| 1956 | 'extra_rows' => array(), |
| 1957 | 'show_in_edit' => true, |
| 1958 | 'show_in_modal' => true, |
| 1959 | ); |
| Line | Code |
| 3313 | |
| 3314 | $media_dims = ''; |
| 3315 | $meta = wp_get_attachment_metadata( $attachment_id ); |
| 3316 | |
| 3317 | if ( isset( $meta['width'], $meta['height'] ) ) { |
| 3318 | /* translators: 1: A number of pixels wide, 2: A number of pixels tall. */ |
| 3319 | $media_dims .= "<span id='media-dims-$attachment_id'>" . sprintf( __( '%1$s by %2$s pixels' ), $meta['width'], $meta['height'] ) . '</span>'; |
| 3320 | } |
| 3321 | /** This filter is documented in wp-admin/includes/media.php */ |
| 3322 | $media_dims = apply_filters( 'media_meta', $media_dims, $post ); |
| 3323 | |
| 3324 | $att_url = wp_get_attachment_url( $attachment_id ); |
| 3325 | |
| 3326 | $author = new WP_User( $post->post_author ); |
| 3327 | |
| 3328 | $uploaded_by_name = __( '(no author)' ); |
| 3329 | $uploaded_by_link = ''; |
| 3330 | |
| 3331 | if ( $author->exists() ) { |