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 michael-cannon/5833716 to your computer and use it in GitHub Desktop.
Save michael-cannon/5833716 to your computer and use it in GitHub Desktop.
Filter testimonials_widget_posts_custom_column example
add_filter( 'testimonials_widget_posts_custom_column', array( &$this, 'posts_custom_column' ), 10, 3 );
public function posts_custom_column( $result, $column, $post_id ) {
switch ( $column ) {
case 'testimonials-widget-read-more-link':
$url = get_post_meta( $post_id, $column, true );
if ( ! empty( $url ) && 0 === preg_match( '#https?://#', $url ) ) {
$url = 'http://' . $url;
}
$result = make_clickable( $url );
break;
}
return $result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment