芝麻web文件管理V1.00
编辑当前文件:/home/r5772835/public_html/blog.ycreate.jp/wp-content/themes/swell/lib/hooks/remove.php
$link ) { if ( 0 === strpos( $link, $home ) ) { unset( $post_links[ $key ] ); } } } ); } if ( $OPTION['remove_robots_image'] ) { remove_filter( 'wp_robots', 'wp_robots_max_image_preview_large' ); } if ( ! $OPTION['remove_media_inf_scrll'] ) { add_filter( 'media_library_infinite_scrolling', '__return_true' ); } /** * script/styleタグで不要なtype属性を非表示 */ // add_filter('script_loader_tag', function ($tag) { // return str_replace("type='text/javascript' ", "", $tag); // }); // add_filter('style_loader_tag', function ($tag) { // return str_replace("type='text/css' ", "", $tag); // }); } /** * 設定に合わせて不要な機能・出力を削除 */ add_action( 'wp_loaded', __NAMESPACE__ . '\remove_swell_func', 99 ); function remove_swell_func() { if ( 'lazy' !== \SWELL_Theme::$lazy_type ) { // loading="lazy" の自動付与を停止。(コメントエリアなどの画像に影響がないように context で判定する) add_filter( 'wp_lazy_loading_enabled', function( $default, $tag_name, $context ) { if ( 'the_content' === $context || str_contains( $context, 'widget_' ) ) { return false; } return $default; }, 10, 3 ); } }