Skip to content

Instantly share code, notes, and snippets.

@marushu
Created December 4, 2021 14:54
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 marushu/aad003193cfe783b356bad13c4cc6ef2 to your computer and use it in GitHub Desktop.
Save marushu/aad003193cfe783b356bad13c4cc6ef2 to your computer and use it in GitHub Desktop.
<?php
/**
* ブロックエディタのoEmbedへcss追加
* wp-content/themes/snow-monkey/vendor/inc2734/wp-oembed-blog-card/src/App/View/View.php
* apply_filters( 'inc2734_wp_oembed_blog_card_block_editor_template', $template, $url );
*/
add_filter(
'inc2734_wp_oembed_blog_card_block_editor_template',
function ( $template, $url ) {
$template .= sprintf(
'<link rel="stylesheet" href="%1$s?ver=%2$s">',
esc_url_raw( MY_SNOW_MONKEY_URL . '/embed/embed-min.css' ),
filemtime( MY_SNOW_MONKEY_PATH . '/embed/embed-min.css' )
);
return $template;
},
11,
2
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment