Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter lazyym

    (@lazyym)

    I tried it and it seems to work great!

    add_filter( ‘wp_insert_attachment_data’, function( $data, $postarr )
    {
    if(
    empty( $postarr[‘ID’] )
    && isset( $postarr[‘post_mime_type’] )
    && wp_match_mime_types( ‘image’, $postarr[‘post_mime_type’] )
    )
    $data[‘post_title’] = ‘Your custom title here’;

    return $data;
    }, 10, 2 );

    Plugin Author Archetyped

    (@archetyped)

    Hi, glad to hear you found a solution that works for your needs!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Replace default image title’ is closed to new replies.