Images "Facebook" prefix

Home Forums Calendar Products Event Aggregator Images "Facebook" prefix

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1220831
    Ivan
    Participant

    Hi Tribe,

    I have a question. In previous facebook events plugin all the images have prefix facebook & unique string, unfortunately the Aggregator not anymore. Is it possible to add the prefix back?

    Was much easier to search for images, delete them or just make some order…

    #1221091
    Nico
    Member

    Hi there Ivan,

    Thanks for getting in touch with us on this!

    I’m not sure this prefix will be added again, but you can use the snippet below to customize the attachment name. Paste the snippet in the theme’s (or child theme’s) functions.php file:

    function tribe_tag_as_ea_image ( $attachment_id ) {

    $attachment = array(
    'ID' => $attachment_id,
    'post_title' => 'aggregator_image_' . $attachment_id
    );

    wp_update_post( $attachment );
    }

    function tribe_hijack_image_name ( $image_import, $event ) {

    tribe_tag_as_ea_image ( $image_import->post_id );

    return $image_import;
    }
    add_filter( 'tribe_aggregator_event_image', 'tribe_hijack_image_name' , 10, 2 );

    It’s a tricky snippet, but worked well in my test site. Try it out and let me know if it works for you,

    Best,
    Nico

    #1221690
    Ivan
    Participant

    Thanks, I tried, but something went wrong. My page was not able to load after add this code to function.php – just stay blank with no error.

    #1222561
    Nico
    Member

    Thanks for following up Ivan! And sorry to hear that this didn’t work as expected ๐Ÿ™

    I just retested the snippet and it’s working fine in my end. Sometimes copying the code directly from the forums lead to erros, try pasting it in a plain text editor first and then from there copy it to the actual file. Copying it from the gist below might help to:

    https://gist.github.com/niconerd/59cd5b76382224bd8d84abd065238bc7

    Please let me know if this helps,
    Best,
    Nico

    #1226052
    Ivan
    Participant

    Yes, you are right. This was the mistake! Thank you so much.

    #1226172
    Nico
    Member

    Thanks for confirming Ivan! Glad to be of service ๐Ÿ™‚

    Iโ€™ll go ahead and close out this thread, but if you need help with anything else please donโ€™t hesitate to create a new one and we will be happy to assist you.

    Best,
    Nico

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Images "Facebook" prefix’ is closed to new replies.