Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save n7studios/eee456e71c3d85b477071f0ce0a95369 to your computer and use it in GitHub Desktop.
Save n7studios/eee456e71c3d85b477071f0ce0a95369 to your computer and use it in GitHub Desktop.
WordPress to Buffer: Modify Term Hashtag
<?php
/**
* Plugin Name: WP to Buffer: Modify Term Hashtag
* Plugin URI: http://www.wpzinc.com/
* Version: 0.0.1
* Author: WP Zinc
* Author URI: http://www.wpzinc.com
* Description: Modify any {taxonomy} based hashtag output, immediately before it is sent to Buffer.
*/
/**
* Modifies the Taxonomy Term Hashtag output, immediately before it is sent to Buffer.
*
* @since 0.0.1
*
* @param string $term_hashtag Term Hashtag
* @param string $taxonomy_term_format Taxonomy Term Format
* @param WP_Term $term Term
* @param string $taxonomy Taxonomy
* @param string $text Status Text
* @return string Modified Term Hashtag
*/
function wp_to_buffer_pro_modify_term_hashtag( $term_hashtag, $taxonomy_term_format, $term, $taxonomy, $text ) {
$term_hashtag = str_replace( '-', '', $term_hashtag );
return $term_hashtag;
}
add_filter( 'wp_to_buffer_pro_publish_parse_text_term_hashtag', 'wp_to_buffer_pro_modify_term_hashtag', 10, 5 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment