A Pen by Angel Centeno on CodePen.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // MUST HAVE TwitterOAuth library installed | |
| // POST TWEET | |
| require $_SERVER['DOCUMENT_ROOT']."/wp-content/themes/emp/twitteroauth/autoload.php"; | |
| use Abraham\TwitterOAuth\TwitterOAuth; | |
| function sendTweet($tweetMessage) { | |
| $user_id = get_current_user_id(); | |
| $key = 'twitter_access_token'; | |
| $ckeytw = get_user_meta( $user_id, $key, false ); | |
| $ckeytwDecoded = json_decode( $ckeytw[0], true ); |