WC_Embed::init
Init embed class.
Method of the class: WC_Embed{}
No Hooks.
Returns
null. Nothing (null).
Usage
$result = WC_Embed::init();
Changelog
| Since 2.4.11 | Introduced. |
WC_Embed::init() WC Embed::init code WC 10.6.2
public static function init() {
// Filter all of the content that's going to be embedded.
add_filter( 'the_excerpt_embed', array( __CLASS__, 'the_excerpt' ), 10 );
// Make sure no comments display. Doesn't make sense for products.
add_action( 'embed_content_meta', array( __CLASS__, 'remove_comments_button' ), 5 );
// In the comments place let's display the product rating.
add_action( 'embed_content_meta', array( __CLASS__, 'get_ratings' ), 5 );
// Add some basic styles.
add_action( 'embed_head', array( __CLASS__, 'print_embed_styles' ) );
}