taxonomy->name; } public function get_label() { /* translators: %s: Singular taxonomy label. */ return sprintf( esc_html__( 'Any Child %s Of', 'elementor-pro' ), $this->taxonomy->labels->singular_name ); } public function __construct( $data ) { parent::__construct( $data ); $this->taxonomy = $data['object']; } public function check( $args ) { $id = (int) $args['id']; /** * @var \WP_Term $current */ $current = get_queried_object(); if ( ! $this->is_term() || 0 === $current->parent ) { return false; } while ( $current->parent > 0 ) { if ( $id === $current->parent ) { return true; } $current = get_term_by( 'id', $current->parent, $current->taxonomy ); } return $id === $current->parent; } }