Call to undefined function get_term_meta

i have a very small problem. I hope someone could enlighten me why this is giving me this error. I have here my function that displays the url of the image of one of my category under my custom taxonomy called ‘item_category’. this is under functions.php

function list_all_categories(){

$categories = get_term( 2 ,'item_category' );
$src = get_term_meta(2,'javo_item_category_featured',true);

echo $src;

}
add_shortcode( 'list','list_all_categories' );

Related posts

Leave a Reply

1 comment

  1. You must update your WordPress to have access to the get_term_meta function since you’re runing version 4.2.6 but it’s released on 4.4.0.

    You can see it in the documentation here:
    https://developer.wordpress.org/reference/functions/get_term_meta/

    If you don’t want to update for whatever reason, the source of the function:

    function get_term_meta( $term_id, $key = '', $single = false ) {
        // Bail if term meta table is not installed.
        if ( get_option( 'db_version' ) < 34370 ) {
            return false;
        }
    
        return get_metadata( 'term', $term_id, $key, $single );
    }