get_attachment_fields_to_edit example

$toggle_off = __( 'Hide' );

    $file     = get_attached_file( $post->ID );
    $filename = esc_html( wp_basename( $file ) );
    $title    = esc_attr( $post->post_title );

    $post_mime_types = get_post_mime_types();
    $keys            = array_keys( wp_match_mime_types( array_keys( $post_mime_types )$post->post_mime_type ) );
    $type            = reset( $keys );
    $type_html       = "<input type='hidden' id='type-of-$attachment_id' value='" . esc_attr( $type ) . "' />";

    $form_fields = get_attachment_fields_to_edit( $post$parsed_args['errors'] );

    if ( $parsed_args['toggle'] ) {
        $class        = empty( $parsed_args['errors'] ) ? 'startclosed' : 'startopen';
        $toggle_links = " <a class='toggle describe-toggle-on' href='#'>$toggle_on</a> <a class='toggle describe-toggle-off' href='#'>$toggle_off</a>";
    } else {
        $class        = '';
        $toggle_links = '';
    }

    
Home | Imprint | This part of the site doesn't use cookies.