nxs_doProcessTags

The NextScripts: Social Networks Auto-Poster nxs doProcessTags function.

Description

nxs_doProcessTags( $tags ); 

Parameters (1)

0. $tags
The tags.

Usage

  1. if ( !function_exists( 'nxs_doProcessTags' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'nextscripts-social-networks-auto-poster/nxs_functions.php'; 
  3.  
  4. // The tags. 
  5. $tags = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = nxs_doProcessTags($tags); 
  9.  

Defined (1)

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

/nxs_functions.php  
  1. if (!function_exists('nxs_doProcessTags')) { function nxs_doProcessTags($tags) { $tagsA = array(); if (!is_array($tags)) { $tags = explode(', ', $tags);  
  2. foreach ($tags as $tg) $tagsA[] = trim($tg); } else $tagsA = $tags; $tagsA = array_unique($tagsA); $tags = array();  
  3. foreach ($tagsA as $tg) { $tags['tagsA'][] = $tg; $tags['htagsA'][] = "#".trim(str_replace(' ', '', preg_replace('/[^a-zA-Z0-9\p{L}\p{N}\s]/u', '', trim(ucwords(str_ireplace('&', '', str_ireplace('&', '', $tg))))))); }  
  4. $tags['tags'] = implode(', ', $tags['tagsA']); $tags['htags'] = implode(', ', $tags['htagsA']); 
  5. return $tags; 
  6. }}