Skip to:
Content

  • Home
  • Integrations
  • Help
  • Blog
  • Download
Automator Developer Resources

Code Reference

  • Home
  • Reference
Filter by type:
Search
Browse: Home / Reference / Classes / WP_VIEWPOST / WP_VIEWPOST::view_post()

WP_VIEWPOST::view_post()

Validation function when the trigger action is hit


Source

File: src/integrations/wp/triggers/wp-viewpost.php

	public function view_post() {



		global $post;
		$user_id = get_current_user_id();

		if ( ! is_single() ) {
			return;
		}

		$args = [
			'code'    => $this->trigger_code,
			'meta'    => $this->trigger_meta,
			'post_id' => $post->ID,
			'user_id' => $user_id,
		];

		Automator()->maybe_add_trigger_entry( $args );
	}

Expand full source code Collapse full source code View on Github


Twitter • Facebook • YouTube • Contact Us • Privacy • Terms of Service