SHEET_UPDATERECORD::define_action()

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


Source Source

File: src/integrations/google-sheet/actions/sheet-updaterecord.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, 'knowledge-base/google-sheets/' ),
			'is_pro'             => false,
			'integration'        => self::$integration,
			'code'               => $this->action_code,
			'sentence'           => sprintf(
				/* translators: Action sentence */
				esc_html__( 'Update a row in a {{Google Sheet:%1$s}}', 'uncanny-automator' ),
				$this->action_meta
			),
			'select_option_name' => esc_html__( 'Update a row in a {{Google Sheet}}', 'uncanny-automator' ),
			'priority'           => 10,
			'accepted_args'      => 1,
			'requires_user'      => false,
			'execution_function' => array( $this, 'update_row_google_sheet' ),
			'options_callback'   => array( $this, 'load_options' ),
			'custom_html'        => $this->custom_html(),
			'buttons'            => array(
				array(
					'show_in'     => $this->action_meta,
					'text'        => __( 'Get columns', 'uncanny-automator' ),
					'css_classes' => 'uap-btn uap-btn--red',
					'on_click'    => $this->get_samples_js(),
					'modules'     => array( 'modal', 'markdown' ),
				),
			),
		);

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