• Hi! When I use Taxonomy field in Repeater I get error:

    ( ! ) Fatal error: Uncaught Error: Object of class WP_Term could not be converted to string in \wp-content\plugins\acf-repeater-for-elementor\acf-repeater-for-elementor.php on line 91

    It happens only when return format of Taxonomy field is Object (WP_Term). When I change the return format to Term ID, ID of the term will be returned (e.g. 125, 134, 129).

    How to return term name or even term archive url?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter radzio1615

    (@radzio1615)

    I’m trying to solve this problem by creating a shortcode that will display term name based on term id but unfortunately it doesn’t work with plugin.

    My shortcode:

    function term_info_shortcode( $atts = '' ) {
        $value = shortcode_atts( array(
            'id' => '',
        ), $atts );
    
        $term_name = get_term( $value['id'] )->name;
    
        return $term_name;
    }
    add_shortcode( 'term_info', 'term_info_shortcode' );

    In elementor text field I add:
    [term_info id="#cpt_category"]

    Returned text:
    [term_info id="162"] instead Category Name

    Plugin Author Sympl

    (@idocoh)

    The plugin does not support Taxonomy field type currently.
    But I will work on it in the future.

    For now I think you can solve this using acf-format_value hook and modify the value from the id of the Taxonomy and return the string of it.

    Let me know if that helped.

    • This reply was modified 3 years, 7 months ago by Sympl.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘ERROR: WP_Term could not be converted to string’ is closed to new replies.