LD_ENRLCOURSE_A::define_action()

Define and register the action by pushing it into the Automator object


Source Source

File: src/integrations/learndash/actions/ld-enrlcourse-a.php

	public function define_action() {



		$action = array(
			'author'             => Automator()->get_author_name(),
			'support_link'       => Automator()->get_author_support_link( $this->action_code, 'integration/learndash/' ),
			'integration'        => self::$integration,
			'code'               => $this->action_code,
			/* translators: Action - LearnDash */
			'sentence'           => sprintf( esc_attr__( 'Enroll the user in {{a course:%1$s}}', 'uncanny-automator' ), $this->action_meta ),
			/* translators: Action - LearnDash */
			'select_option_name' => esc_attr__( 'Enroll the user in {{a course}}', 'uncanny-automator' ),
			'priority'           => 10,
			'accepted_args'      => 1,
			'execution_function' => array( $this, 'enroll_in_course' ),
			'options'            => [
				Automator()->helpers->recipe->learndash->options->all_ld_courses( null, 'LDCOURSE', false ),
			],
		);

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