nxs_rePostToLI_ajax

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

Description

nxs_rePostToLI_ajax(); 

Usage

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

Defined (1)

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

/inc-cl/li.php  
  1. if (!function_exists("nxs_rePostToLI_ajax")) { function nxs_rePostToLI_ajax() { check_ajax_referer('nxsSsPageWPN'); $postID = $_POST['id']; // $result = nsPublishTo($id, 'FB', true);  
  2. global $plgn_NS_SNAutoPoster; if (!isset($plgn_NS_SNAutoPoster)) return; $options = $plgn_NS_SNAutoPoster->nxs_options;  
  3. foreach ($options['li'] as $ii=>$po) if ($ii==$_POST['nid']) { $po['ii'] = $ii; $po['pType'] = 'aj'; 
  4. $mpo = get_post_meta($postID, 'snapLI', true); $mpo = maybe_unserialize($mpo); 
  5. if (is_array($mpo) && isset($mpo[$ii]) && is_array($mpo[$ii]) ) { $ntClInst = new nxs_snapClassLI(); $po = $ntClInst->adjMetaOpt($po, $mpo[$ii]); }  
  6. $result = nxs_doPublishToLI($postID, $po);  
  7. if ($result == 200 && ($postID=='0') && (!isset($options['li'][$ii]['liOK']) || $options['li'][$ii]['liOK']!='1')) { $options['li'][$ii]['liOK']=1; update_option('NS_SNAutoPoster', $options); } 
  8. if ($result == 200) die("Successfully sent your post to LinkedIn."); else die($result); 
  9. }