• Resolved swayam.tejwani

    (@swayamtejwani)


    Hello,

    I have woocommerce installed and there is one category which contains & like this “7 FARM & RURAL”, now when i try to retrieve category id by name i am using this function

    function get_wocom_cat_ID( $cat_name='General' ) {
    	$cat = get_term_by( 'name', $cat_name, 'product_cat' );
    	if ( $cat )
    		return $cat->term_id;
    	return 0;
    }

    and when i call the function by passing term name as a paramater then it does not retreive the id..for the rest of the terms which dont have & its returning the id but for this its not..If anyone have some sort of solution then please reply ASAP.

  • The topic ‘& character Issue in custom taxonomy’ is closed to new replies.