TWITTER_POSTSTATUS::define_action()

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


Source

File: src/integrations/twitter/actions/twitter-poststatus.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/twitter/' ),
			'integration'        => self::$integration,
			'code'               => $this->action_code,
			'sentence'           => sprintf( __( 'Post {{a status:%1$s}} to Twitter', 'uncanny-automator' ), $this->action_meta ),
			'select_option_name' => __( 'Post {{a status}} to Twitter', 'uncanny-automator' ),
			'priority'           => 10,
			'accepted_args'      => 1,
			'execution_function' => array( $this, 'post_status' ),
			'options_group'      => array(
				$this->action_meta => array(
					Automator()->helpers->recipe->twitter->textarea_field( 'TWITTERSTATUSCONTENT', esc_attr__( 'Status', 'uncanny-automator' ), true, 'textarea', '', true, esc_attr__( "Messages posted to Twitter have a 280 character limit.", 'uncanny-automator' ), __( 'Enter the message', 'uncanny-automator' ), 278 ),
					//Temporary fix for the UI
					array(
						'input_type'  => 'text',
						'option_code' => 'TWITTERSTATUSCONTENTHIDDEN',
						'is_hidden'   => true,
					),
				),
			),
		);

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