get_token_factory() ->variable( $field_id ) ->add_item_path( 'value' ); $markup_field_data->get_token_factory() ->to_echo( $var ) ->print(); } /** * @return array */ public function get_template_variables( Variable_Field_Data $variable_field_data ): array { $args = array( 'value' => '', ); $comment = $this->get_comment( $variable_field_data->get_value() ); if ( null === $comment ) { return $args; } $user = get_user_by( 'email', $comment->comment_author_email ); if ( ! ( $user instanceof WP_User ) ) { return $args; } $args['value'] = $user->ID; return $args; } /** * @return array */ public function get_validation_template_variables( Variable_Field_Data $variable_field_data ): array { return array( 'value' => '1', ); } public function is_with_field_wrapper( Layout_Settings $layout_settings, Field_Settings $field_settings, Field_Meta $field_meta ): bool { return true; } public function get_custom_field_wrapper_tag(): string { return 'p'; } }