Warning: Array to string conversion in /home/customer/www/docs.automatorplugin.com/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 825
FACEBOOK_GROUP_PUBLISH_POST::process_action( $user_id, $action_data, $recipe_id, $args, $parsed )
Proccess the action.
Return Return
(Uncanny_Automatorvoid.)
Source Source
File: src/integrations/facebook-groups/actions/facebook-group-publish-post.php
public function process_action( $user_id, $action_data, $recipe_id, $args, $parsed ) { $helper = Automator()->helpers->recipe->facebook_groups->options; $group_id = isset( $parsed[ $this->get_action_meta() ] ) ? sanitize_text_field( $parsed[ $this->get_action_meta() ] ) : 0; $message = isset( $parsed['FACEBOOK_GROUP_MESSAGE'] ) ? sanitize_textarea_field( $parsed['FACEBOOK_GROUP_MESSAGE'] ) : ''; $body = array( 'action' => 'send_message', 'access_token' => $helper->get_user_access_token(), 'message' => $message, 'group_id' => $group_id, ); try { $helper->api_request( $body, $action_data ); Automator()->complete->action( $user_id, $action_data, $recipe_id ); } catch ( \Exception $e ) { $action_data['complete_with_errors'] = true; // Log error if there are any error messages. Automator()->complete->action( $user_id, $action_data, $recipe_id, $e->getMessage() ); } }
Expand full source code Collapse full source code View on Github