Skip to content

Instantly share code, notes, and snippets.

Greg Perham swinggraphics

  • Swing Graphics
  • Northampton, MA
View GitHub Profile
swinggraphics / allow-links-in-excerpts.php
Created Jun 7, 2018
WordPress strips out tags in `wp_trim_words()`, which is called by `get_the_excerpt()`; so we have to filter 'wp_trim_words', basically copying that function with one change: replace `wp_strip_all_tags()` with `strip_tags()`. We don't want other functions that run `wp_trim_words` to be modified, so we add our filter while `get_the_excerpt()` is …
View allow-links-in-excerpts.php
swinggraphics / broadcast-replace-site_url.php
Created May 14, 2018
Replace site_url in posts syndicated by WP Broadcast
View broadcast-replace-site_url.php
* 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.
You can’t perform that action at this time.