LF_MARKLESSONDONE::define_action()

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


Source Source

File: src/integrations/lifterlms/actions/lf-marklessondone.php

	public function define_action() {



		$action = array(
			'author'             => Automator()->get_author_name( $this->action_code ),
			'support_link'       => Automator()->get_author_support_link( $this->action_code, 'integration/lifterlms/' ),
			'integration'        => self::$integration,
			'code'               => $this->action_code,
			/* translators: Action - LifterLMS */
			'sentence'           => sprintf( esc_attr__( 'Mark {{a lesson:%1$s}} complete for the user', 'uncanny-automator' ), $this->action_meta ),
			/* translators: Action - LifterLMS */
			'select_option_name' => esc_attr__( 'Mark {{a lesson}} complete for the user', 'uncanny-automator' ),
			'priority'           => 10,
			'accepted_args'      => 1,
			'execution_function' => array( $this, 'lf_mark_lesson_done' ),
			'options'            => [
				Automator()->helpers->recipe->lifterlms->options->all_lf_lessons( esc_attr__( 'Lesson', 'uncanny-automator' ), $this->action_meta, false ),
			],
		);

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