WCM_ADDUSER_A::define_action()


Source Source

File: src/integrations/wc-memberships/actions/wcm-adduser-a.php

	public function define_action() {


		$action = [
			'author'             => Automator()->get_author_name( $this->action_code ),
			'support_link'       => Automator()->get_author_support_link( $this->action_code, 'integration/woocommerce-memberships/' ),
			'integration'        => self::$integration,
			'code'               => $this->action_code,
			/* translators: Action - WooCommerce Memberships */
			'sentence'           => sprintf( esc_attr__( 'Add the user to {{a membership plan:%1$s}}',
				'uncanny-automator' ), $this->action_meta ),
			/* translators: Action - WooCommerce Memberships */
			'select_option_name' => esc_attr__( 'Add the user to {{a membership plan}}', 'uncanny-automator' ),
			'priority'           => 10,
			'accepted_args'      => 1,
			'execution_function' => [ $this, 'add_user_to_membership_plan' ],
			'options'            => [
				Automator()->helpers->recipe->wc_memberships->options->wcm_get_all_membership_plans( null,
					$this->action_meta ),
			],
		];

		Automator()->register->action( $action );
	}