This file contains 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 | |
add_filter( 'oembed_response_data', 'fwe_oembed_response_data', 11, 4 ); | |
function fwe_oembed_response_data( $data, $post, $width, $height ){ | |
if ( ! is_object( $post ) ) | |
return $data; | |
if( ! has_post_thumbnail( $post->ID ) ) | |
return $data; | |
$thumbnail_id = get_post_thumbnail_id( $post->ID ); | |
$image = wp_get_attachment_image_src( $thumbnail_id, 'full' ); |
This file contains 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 | |
\add_filter( 'wc_add_to_cart_message', function( $string, $product_id = 0 ) { | |
$start = strpos( $string, '<a href=' ) ?: 0; | |
$end = strpos( $string, '</a>', $start ) ?: 0; | |
return substr( $string, $end ) ?: $string; | |
} ); |