I wrote some scripts to add the custom image field to the custom taxonomy that I registered.
The problem is now I'm trying to get the term meta data, by the way since the add_term_meta function is introduced from version 4.4 of wordpress I can't use this function.
Now I'm using wordpress version 4.2 for the website cause of there are bunch of custom plugins and scripts there.
Which function I have to use to get the term meta data on version 4.2?
** EDIT **
add_action( 'created_hr50_amenity', 'save_hr50_amenity_image', 10, 2 );
function save_hr50_amenity_image ( $term_id, $tt_id ) {
if( isset( $_POST['hr50_amenity-image-id'] ) && '' !== $_POST['hr50_amenity-image-id'] ){
$image = $_POST['hr50_amenity-image-id'];
// ** add_term_meta ** WHAT CAN I USE INSTEAD OF THIS FUNCTION? **
add_term_meta( $term_id, 'hr50_amenity-image-id', $image, true );
// var_dump(get_term_meta( $term_id, 'hr50_amenity-image-id'));
}
}