• Resolved lozula

    (@lozula)


    Updated to the latest version of the plugin. It broke my site, presumably because I was using the following function call: rgc_get_term_meta to build a category page with thumbnails.

    has this been replaced with something else?

Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Author theMikeD

    (@themiked)

    Hi Lozula,

    Give me a sec to look into this for you.

    Thread Starter lozula

    (@lozula)

    Thanks very much. I looked through the code and it seems I probably should have been using gtaxi_get_taxonomy_image instead, but the 2.0.0 code appears to suggest this is deprecated.

    Plugin Author theMikeD

    (@themiked)

    Before I answer, can I see the exact function call you’re using please?

    Thread Starter lozula

    (@lozula)

    Sure. Ultimately I just want the image src for the term image for the current page I am on, which is a category page.

    $term_image_id = rgc_get_term_meta($term, ‘term_thumbnail_id’);

    Plugin Author theMikeD

    (@themiked)

    OK. The reason I asked to see how you’re using it is so that I can see if you’re using it specifically for the term meta stored with this plugin, or if you’re using it for the general retrieval of term meta.

    rgc_get_term_meta() is a wrapper for two things: get_term_meta() and then if that failed, to get the term meta that Genesis used to add in pre-2.3.0 (2016). This code still exists in the updated plugin (which you can see here). However this is a private method not accessible directly.

    The only reason this code still exists is for people running Genesis pre-2.3.0, when genesis slurped in all term meta whenever a term object was retrieved. This hasn’t been in Genesis since 2016 and I plan to phase out support for it at some point in the future.

    So there are two options. First, I can add back that function for you. However I don’t suggest this.

    The second solution is to use either gtaxi_get_taxonomy_image or get_term_meta to get the image ID.

    Marking gtaxi_get_taxonomy_image as deprecated was a mistake that I’ll fix shortly.

    • This reply was modified 4 years, 9 months ago by theMikeD.
    Thread Starter lozula

    (@lozula)

    Thanks for the comprehensive and useful response ?? No need to add the function back in, I’ll use one of the other two options you suggest.

    Plugin Author theMikeD

    (@themiked)

    Try v2.0.1 pls, I fixed a small error.

    Thread Starter lozula

    (@lozula)

    Hi – ah, thank goodness. I was going slightly crazy trying to figure out why my code wasn’t working ?? Can confirm 2.0.1 works fine, now using gtaxi_get_taxonomy_image function.

    Plugin Author theMikeD

    (@themiked)

    Great! Thanks for your patience and for helping me improve the code! I’ll mark this as closed now but please open a new thread if you see any other weirdness ??

    Man, the update to v.2.0.1 broke my category listings with:
    Fatal error: Uncaught Error: Call to undefined function rgc_get_term_meta() in…

    I’ve used the function directly with the following code:
    if( function_exists(‘gtaxi_get_taxonomy_image’) ) {
    $image_term_id = rgc_get_term_meta( $term, ‘term_thumbnail_id’ );
    }

    Plugin Author theMikeD

    (@themiked)

    Hi Ivan,

    Sorry about that! I didn’t realize this function was being used directly. Please update your code to use

    $image_term_id = gtaxi_get_taxonomy_image( array( 'term' => $term, 'format' => 'id' ) );

    instead of

    $image_term_id = rgc_get_term_meta( $term, ‘term_thumbnail_id’ );

    • This reply was modified 4 years, 9 months ago by theMikeD.

    I had actually replaced it all with WordPress native, plugin independent:

    $image_term_id = get_term_meta( $term->term_id, ‘term_thumbnail_id’, true );

    Plugin Author theMikeD

    (@themiked)

    Even better!

    Thank you for a great plugin – it is a must-have functionality, I think.

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Errors in 2.0.0’ is closed to new replies.