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
// Allow links in excerpts | |
function sg_trim_words( $text, $num_words, $more, $original_text ) { | |
$text = strip_tags( $original_text, '<a>' ); | |
// @See wp_trim_words in wp-includes/formatting.php | |
if ( strpos( _x( 'words', 'Word count type. Do not translate!' ), 'characters' ) === 0 && preg_match( '/^utf\-?8$/i', get_option( 'blog_charset' ) ) ) { | |
$text = trim( preg_replace( "/[\n\r\t ]+/", ' ', $text ), ' ' ); | |
preg_match_all( '/./u', $text, $words_array ); | |
$words_array = array_slice( $words_array[0], 0, $num_words + 1 ); | |
$sep = ''; | |
} else { |
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
<? | |
/** | |
* Hook into Broadcast | |
* Modify links in the broadcasted post content | |
* "Replace Site URL" checkbox appears in child post meta box to show if this was applied | |
*/ | |
add_action( 'threewp_broadcast_prepare_meta_box', 'my_custom_prepare_meta_box' ); | |
function my_custom_prepare_meta_box( $action ) { | |
$meta_box_data = $action->meta_box_data; // Convenience. |
NewerOlder