Created
July 30, 2019 14:55
-
-
Save n7studios/eee456e71c3d85b477071f0ce0a95369 to your computer and use it in GitHub Desktop.
WordPress to Buffer: Modify Term Hashtag
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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