nxs_rePostToTW_ajax

The NextScripts: Social Networks Auto-Poster nxs rePostToTW ajax function.

Description

nxs_rePostToTW_ajax(); 

Usage

  1. if ( !function_exists( 'nxs_rePostToTW_ajax' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'nextscripts-social-networks-auto-poster/inc-cl/tw.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = nxs_rePostToTW_ajax(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/inc-cl/tw.php  
  1. function nxs_rePostToTW_ajax() { check_ajax_referer('nxsSsPageWPN'); $postID = $_POST['id']; $options = get_option('NS_SNAutoPoster');  
  2. foreach ($options['tw'] as $ii=>$nto) if ($ii==$_POST['nid']) { $nto['ii'] = $ii; $nto['pType'] = 'aj'; 
  3. $twpo = get_post_meta($postID, 'snapTW', true); $twpo = maybe_unserialize($twpo); // prr($ii); prr($nto); prr($twpo); die(); 
  4. if (is_array($twpo) && isset($twpo[$ii]) && is_array($twpo[$ii]) && isset($twpo[$ii]['SNAPformat']) ) { $ntClInst = new nxs_snapClassTW(); $nto = $ntClInst->adjMetaOpt($nto, $twpo[$ii]);}  
  5. if (isset($_POST['ri']) && $_POST['ri']=='1') { $twList = nxs_getBackTWCommentsList($nto); nxs_getBackTWComments($postID, $nto, $twpo[$ii], $twList); die(); } else { 
  6. $result = nxs_doPublishToTW($postID, $nto); if ($result == 200) {$options['tw'][$ii]['twOK']=1; update_option('NS_SNAutoPoster', $options); } if ($result == 200) die("Successfully sent your post to Twitter."); else die($result);