Skip to content

Commit

Permalink
Apply linting
Browse files Browse the repository at this point in the history
  • Loading branch information
angusmcleod committed Jan 15, 2024
1 parent ea2b41a commit 022933e
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions lib/utilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -406,24 +406,25 @@ public static function discourse_munge( $data, $schema ) {
}

/**
* Publishes a post to a Discourse.
*
* @param string $post_id ID of the post to publish.
*
* @return void;
*/
* Publishes a post to a Discourse.
*
* @param string $post_id ID of the post to publish.
*
* @return void;
*/
public static function publish_to_discourse( $post_id ) {
$post = get_post( $post_id );
$post = get_post( $post_id );

if ( !$post ) {
return new \WP_Error( 'wpdc_param_error', 'There is no WordPress post with the supplied id.' );
}
if ( ! $post ) {
return new \WP_Error( 'wpdc_param_error', 'There is no WordPress post with the supplied id.' );
}

$email_notifier = new \WPDiscourse\EmailNotification\EmailNotification();
$publish = new \WPDiscourse\DiscoursePublish\DiscoursePublish( $email_notifier, false );
$publish = new \WPDiscourse\DiscoursePublish\DiscoursePublish( $email_notifier, false );
$publish->setup_options();
$publish->setup_logger();

return $publish->sync_to_discourse( $post_id, $post->post_title, $post->post_content );;
return $publish->sync_to_discourse( $post_id, $post->post_title, $post->post_content );

}
}

0 comments on commit 022933e

Please sign in to comment.