GH_REMOVETAG::remove_tag_to_user( $user_id,  $action_data,  $recipe_id )


Parameters Parameters

$user_id

(Required)

$action_data

(Required)

$recipe_id

(Required)


Source Source

File: src/integrations/groundhogg/actions/gh-removetag.php

	public function remove_tag_to_user( $user_id, $action_data, $recipe_id ) {



		$tag_id = absint( $action_data['meta'][ $this->action_meta ] );

		if ( 0 !== $tag_id ) {
			$contact = Plugin::$instance->utils->get_contact( absint( $user_id ), true );

			if ( ! $contact ) {
				return;
			}

			$tags_to_add = [ $tag_id ];
			$contact->remove_tag( $tags_to_add );

		}

		Automator()->complete_action( $user_id, $action_data, $recipe_id );
	}