diff --git a/src/wp-to-twitter-manager.php b/src/wp-to-twitter-manager.php index 4ed26c8..9bbe5d4 100644 --- a/src/wp-to-twitter-manager.php +++ b/src/wp-to-twitter-manager.php @@ -27,7 +27,7 @@ function wpt_updated_settings() { if ( ! wp_verify_nonce( $nonce, 'wp-to-twitter-nonce' ) ) { wp_die( 'XPoster: Security check failed' ); } - // Connect to Twitter + // Connect to Twitter. if ( isset( $_POST['oauth_settings'] ) ) { $post = map_deep( $_POST, 'sanitize_text_field' ); $oauth_message = wpt_update_oauth_settings( false, $post ); diff --git a/src/wp-to-twitter-mastodon.php b/src/wp-to-twitter-mastodon.php index 5268913..a2103cf 100644 --- a/src/wp-to-twitter-mastodon.php +++ b/src/wp-to-twitter-mastodon.php @@ -23,7 +23,7 @@ function wpt_update_mastodon_settings( $auth = false, $post = false ) { wp_die( 'Oops, please try again.' ); } - if ( ! empty( $post['wpt_mastodon_token'] ) && ! empty( $post['wpt_mastodon_instance'] ) ) { + if ( ! empty( $post['wpt_mastodon_token'] ) && ! empty( $post['wpt_mastodon_instance'] ) ) { $ack = sanitize_text_field( trim( $post['wpt_mastodon_token'] ) ); $acs = sanitize_text_field( trim( $post['wpt_mastodon_instance'] ) ); @@ -48,9 +48,9 @@ function wpt_update_mastodon_settings( $auth = false, $post = false ) { 'token' => $ack, 'instance' => $acs, ); - $verify = wpt_mastodon_connection( $auth, $validate ); + $verify = wpt_mastodon_connection( $auth, $validate ); if ( isset( $verify['username'] ) ) { - $username = sanitize_text_field( stripslashes( $verify['username'] ) ); + $username = sanitize_text_field( stripslashes( $verify['username'] ) ); if ( ! $auth ) { update_option( 'wpt_mastodon_username', $username ); } else { diff --git a/src/wpt-post-to-mastodon.php b/src/wpt-post-to-mastodon.php index db87f5e..dcb45ab 100644 --- a/src/wpt-post-to-mastodon.php +++ b/src/wpt-post-to-mastodon.php @@ -50,6 +50,7 @@ function wpt_upload_mastodon_media( $connection, $auth, $attachment, $status, $i 'file' => $attachment_data, 'description' => $alt_text, ); + $response = $connection->upload_media( $request ); $media_id = $response['id']; $status['media_ids[]'] = $media_id;