Populate_From_Query::publish_trigger( $trigger_id )
Populates the POST array and publishes the trigger.
Contents
Parameters Parameters
- $trigger_id
-
(Required)
Return Return
(bool)
Source Source
File: src/core/classes/class-populate-from-query.php
public static function publish_trigger( $trigger_id ) { $_POST['post_ID'] = $trigger_id; $_POST['post_status'] = 'publish'; $trigger_status_changed = self::$recipe->change_post_status( '' ); if ( ! $trigger_status_changed->data['success'] ) { throw new \Exception( "Trigger couldn't be published." ); } return true; }
Expand full source code Collapse full source code View on Github