get_compat_media_markup example

$response['thumb']            = compact( 'src', 'width', 'height' );
        } else {
            $src               = wp_mime_type_icon( $attachment->ID );
            $width             = 48;
            $height            = 64;
            $response['image'] = compact( 'src', 'width', 'height' );
            $response['thumb'] = compact( 'src', 'width', 'height' );
        }
    }

    if ( function_exists( 'get_compat_media_markup' ) ) {
        $response['compat'] = get_compat_media_markup( $attachment->ID, array( 'in_modal' => true ) );
    }

    if ( function_exists( 'get_media_states' ) ) {
        $media_states = get_media_states( $attachment );
        if ( ! empty( $media_states ) ) {
            $response['mediaStates'] = implode( ', ', $media_states );
        }
    }

    /** * Filters the attachment data prepared for JavaScript. * * @since 3.5.0 * * @param array $response Array of prepared attachment data. @see wp_prepare_attachment_for_js(). * @param WP_Post $attachment Attachment object. * @param array|false $meta Array of attachment meta data, or false if there is none. */
if ( preg_match( '#^(audio|video)/#', $post->post_mime_type ) ) {
        echo ': ' . __( 'Displayed on attachment pages.' );
    }

    ?> </label> <?php wp_editor( format_to_edit( $post->post_content ), 'attachment_content', $editor_args ); ?> </div> <?php
    $extras = get_compat_media_markup( $post->ID );
    echo $extras['item'];
    echo '<input type="hidden" id="image-edit-context" value="edit-attachment" />' . "\n";
}

/** * Displays non-editable attachment metadata in the publish meta box. * * @since 3.5.0 */
function attachment_submitbox_metadata() {
    $post          = get_post();
    
Home | Imprint | This part of the site doesn't use cookies.