PHP code example of inc2734 / wp-oembed-blog-card

1. Go to this page and download the library: Download inc2734/wp-oembed-blog-card library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

inc2734 / wp-oembed-blog-card example snippets



new \Inc2734\WP_OEmbed_Blog_Card\Bootstrap();

/**
 * Customize template for block editor
 *
 * @param string $template
 * @param string $url
 * @return string
 */
add_filter(
	'inc2734_wp_oembed_blog_card_block_editor_template',
	function( $template, $url ) {
		return $template;
	},
	10,
	2
);

/**
 * Customize template for loading
 *
 * @param string $template
 * @param string $url
 * @return string
 */
add_filter(
	'inc2734_wp_oembed_blog_card_loading_template',
	function( $template, $url ) {
		return $template;
	},
	10,
	2
);

/**
 * Customize url template
 *
 * @param string $template
 * @param string $url
 * @return string
 */
add_filter(
	'inc2734_wp_oembed_blog_card_url_template',
	function( $template, $url ) {
		return $template;
	},
	10,
	2
);

/**
 * Customize blog card template
 *
 * @param string $template
 * @param array $cache
 * @return string
 */
add_filter(
	'inc2734_wp_oembed_blog_card_blog_card_template',
	function( $template, $cache ) {
		return $template;
	},
	10,
	2
);

/**
 * Customize cache directory
 *
 * @param string $directory
 * @return string
 */
add_filter(
	'inc2734_wp_oembed_blog_card_cache_directory',
	function( $directory ) {
		return $directory;
	}
);