Skip to content

Instantly share code, notes, and snippets.

View ang-gitdemon's full-sized avatar

Ang Centeno ang-gitdemon

View GitHub Profile
@ang-gitdemon
ang-gitdemon / index.php
Last active April 12, 2018 00:01
Function that allows admin to post on behalf of a user using Social Login for WooCommerce, Twitter, and Wordpress
// 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 );