• Hi,

    first of all thank you for your work. I came across an issue using this plugin. When I want to use the image meta title as the post title, it is saved as “Untitled” (I double checked the exif title to be sure).

    I looked into the code and tried the following in includes/bip-zone.php (from line 25 to line 50):

    ` $attachment_id = media_handle_upload( ‘bipImage’, 0 );

    $attachment = get_post( $attachment_id );
    $uploadTitleType = get_option(‘bip_image_title’);
    if ( $uploadTitleType == 0) {
    $theoriginaltitle = basename( get_attached_file( $attachment_id ) );
    $titleWithoutExtension = substr($theoriginaltitle, 0, strpos($theoriginaltitle, “.”));
    $thetitle = str_replace(“-“,” “,$titleWithoutExtension);
    } else {
    $theoriginaltitle = get_the_title($attachment_id); // changed $attachment->post_title to get_the_title($attachment_id);
    $thetitle = $theoriginaltitle;
    // Check to see if no title set
    if ( empty($theoriginaltitle)) {
    $theoriginaltitle = basename( get_attached_file( $attachment_id ) );
    $titleWithoutExtension = substr($theoriginaltitle, 0, strpos($theoriginaltitle, “.”));
    $thetitle = str_replace(“-“,” “,$titleWithoutExtension);
    }
    }

    $uploadPostType = get_option(‘bip_post_type’);
    $uploadPostStatus = get_option(‘bip_post_status’);
    $uploadTaxonomy = get_option(‘bip_taxonomy’);
    $uploadTerms = get_option(‘bip_terms’);
    $uploadImageContent = get_option(‘bip_image_content’);
    $uploadImageContentSize = get_option(‘bip_image_content_size’);`

    Basically, I just changed some stuff so the code won’t run in replacement if we want to use the exif title of the file (no str_replace and substr in that case) and used get_the_title($attachment_id); instead of $attachment->post_title (maybe something’s going wrong getting the attachment (but the attachment ID is well returned).

    You may think that looks like a pull request, and well, it is, but I don’t know how to do it properly, but implementing this change in the SVN repo would would be really helpful.

    Best regards,
    Enguerran

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘BUG – exif or meta title not used as Post title’ is closed to new replies.