• Resolved lossehelin

    (@lossehelin)


    Hi. Today’s update messed with the external featured image. not working anymore. no images are shown. everything was running smooth until this update. Using Bimber theme and had no issues before today

Viewing 7 replies - 1 through 7 (of 7 total)
  • Same here. We had to Rollback to the last version.

    We also use a custom filter on our site that makes use of this function which no longer appears to work on the new version:

    
    $imgsrc = get_nelio_featured_image( $post_id );
    

    Same for Genesis theme… Appreciate fixing soon. Thanks

    > We had to Rollback to the last version

    Where can I download that… I don’t mind using outdated stuffs as long as they work

    Plugin Author David Aguilera

    (@davilera)

    Thanks for reporting the bug, guys! We’re working on it right now 🙂

    Plugin Author David Aguilera

    (@davilera)

    Alright! Version 2.0.1 is now ready to download and it should fix the issue.

    @contemplate, I’m curious about the function you mention. Function get_nelio_featured_image was never a “global” function, but a method of the class Nelio_Content_External_Featured_Image_Helper. That is, if you wanted to use it before, you first needed to load an instance of Nelio_Content_External_Featured_Image_Helper and then use it like $instance->get_nelio_featured_image(). You can see the method in the last version prior to Nelio Content 2.0 and the same method in Nelio Content 2.0 – nothing really changed and they should work as expected… What’s exactly amiss? Maybe the fact that we changed the location of the Nelio_Content_External_Featured_Image_Helper class?

    Anyway, in order to make it simpler for user like you to use it, I’ve created a helper function nc_get_external_featured_image( $post_id ). You can use it in your theme as follows:

    if ( function_exists( 'nc_get_external_featured_image' ) ) {
      $img = nc_get_external_featured_image( $post_id );
    }

    (Note I wrapped the function in an if clause. This is very important because, if the function is no longer available, you don’t want your theme to trigger fatal errors)

    @davilera thanks for your work on this. I look forward to playing with the new nc_get_external_featured_image function.

    So here was our full filter function previously that is for Rev Slider to pull the Nelio Feature image if the post doesn’t have a feature image already set. My client almost never sets a feature image and this snippet had been working for us until version 2.0.

    In Rev Slider we have the background image set to external with the placeholder: %rev_neilo_featured_image_url%

    
    /*----------------------------
    //  Rev Slider using Neilo Feature Image 
    -----------------------------*/
    function neilo_rev_slider_insert_meta( $text, $post_id ) {
       if ( function_exists( 'get_nelio_featured_image' ) && get_nelio_featured_image( $post_id ) ) {
               $imgsrc = get_nelio_featured_image( $post_id );
    	   //exit;
                    
       } else if (has_post_thumbnail($post_id)) {
               $image = wp_get_attachment_image_src( get_post_thumbnail_id($post_id));
               $imgsrc = esc_url($image[0]);
       }
    
       return str_replace(array('%rev_neilo_featured_image_url%', '{{rev_neilo_featured_image_url}}'), $imgsrc, $text);
    }
    add_filter( 'rev_slider_insert_meta', 'neilo_rev_slider_insert_meta', 10, 2 );
    
    • This reply was modified 5 years, 8 months ago by contemplate.
    Plugin Author David Aguilera

    (@davilera)

    I don’t remember that function being public anywhere. But maybe someone tweaked the copy of our plugin that your client was running and added the function, which was obviously lost when updating the plugin.

    Just as an example, you can look at this support thread from almost two years ago where I show how that function is actually a method in a class.

    Anyway, looking at the snippet you have, all you need to do is replace the three occurrences of get_nelio_featured_image with the new global function nc_get_external_featured_image. That should do the trick.

    LOL… I don’t “think” I’d ever hack a core plugin but perhaps I did to make this snippet work. Bad practice for sure. 🙁

    Glad your new function will do the trick!!

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

The topic ‘Featured Image stopped working’ is closed to new replies.