MPC_MARKCOURSEDONE::define_action()

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


Source Source

File: src/integrations/memberpress-courses/actions/mpc-markcoursedone.php

	public function define_action() {

		$action = array(
			'author'             => Automator()->get_author_name(),
			'support_link'       => Automator()->get_author_support_link( $this->action_code, 'integration/memberpress-courses/' ),
			'integration'        => self::$integration,
			'code'               => $this->action_code,
			/* translators: Action - Memberpress */
			'sentence'           => sprintf( esc_attr__( 'Mark {{a course:%1$s}} complete for the user', 'uncanny-automator' ), $this->action_meta ),
			/* translators: Action - Memberpress */
			'select_option_name' => esc_attr__( 'Mark {{a course}} complete for the user', 'uncanny-automator' ),
			'priority'           => 10,
			'accepted_args'      => 1,
			'execution_function' => array( $this, 'mark_completes_a_course' ),
			'options'            => array(
				Automator()->helpers->recipe->memberpress_courses->all_mp_courses( null, 'MPCOURSE', false ),
			),
		);

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