Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function sovetit_instagram_embed_provider() {
- wp_embed_register_handler( 'sovetit-instagram', '#https:\/\/www.instagram.com/p/([^\/]*)#', function( $matches, $attr, $url ) {
- return sprintf(
- '<blockquote class="instagram-media" data-instgrm-captioned data-instgrm-permalink="%s" data-instgrm-version="12" style="background:#fff;border:0;border-radius:3px;max-width:540px;min-width:326px;padding:0;width:99.375%%;width:-webkit-calc(100%% - 2px);width:calc(100%% - 2px)">
- <div style="padding:16px;"></div>
- </blockquote><script async defer src="//www.instagram.com/embed.js"></script>'
- , $url );
- });
- }
- add_action( 'init', 'sovetit_instagram_embed_provider' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement