Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.