Skip to content

Commit

Permalink
カテゴリー・タグ共通フックの適用
Browse files Browse the repository at this point in the history
  • Loading branch information
yhira committed Jul 4, 2019
1 parent 532989c commit 944342f
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 24 deletions.
3 changes: 1 addition & 2 deletions lib/ad.php
Expand Up @@ -367,8 +367,7 @@ function is_index_middle_ad_visible($count){

//[ad]ショートコードに対して広告を表示する
add_filter('the_content', 'replace_ad_shortcode_to_advertisement');
add_filter('the_category_content', 'replace_ad_shortcode_to_advertisement');
add_filter('the_tag_content', 'replace_ad_shortcode_to_advertisement');
add_filter('the_category_tag_content', 'replace_ad_shortcode_to_advertisement');
if ( !function_exists( 'replace_ad_shortcode_to_advertisement' ) ):
function replace_ad_shortcode_to_advertisement($the_content){
//[ad]機能が有効な時
Expand Down
6 changes: 2 additions & 4 deletions lib/blogcard-in.php
Expand Up @@ -221,8 +221,7 @@ function url_to_internal_blogcard($the_content) {
add_filter('widget_text_pc_text', 'url_to_internal_blogcard', 11);
add_filter('widget_classic_text', 'url_to_internal_blogcard', 11);
add_filter('widget_text_mobile_text', 'url_to_internal_blogcard', 11);
add_filter('the_category_content', 'url_to_internal_blogcard', 11);
add_filter('the_tag_content', 'url_to_internal_blogcard', 11);
add_filter('the_category_tag_content', 'url_to_internal_blogcard', 11);
}

//本文中のURLショートコードをブログカードタグに変更する
Expand Down Expand Up @@ -294,8 +293,7 @@ function url_shortcode_to_blogcard($the_content) {
add_filter('widget_classic_text', 'url_shortcode_to_blogcard', 9999);
add_filter('widget_text_mobile_text', 'url_shortcode_to_blogcard', 9999);
add_filter('comment_text', 'url_shortcode_to_blogcard', 9999);
add_filter('the_category_content', 'url_shortcode_to_blogcard', 9999);
add_filter('the_tag_content', 'url_shortcode_to_blogcard', 9999);
add_filter('the_category_tag_content', 'url_shortcode_to_blogcard', 9999);

//ブログカード置換用テキストにpタグが含まれているかどうか
if ( !function_exists( 'is_p_tag_appropriate' ) ):
Expand Down
3 changes: 1 addition & 2 deletions lib/blogcard-out.php
Expand Up @@ -63,8 +63,7 @@ function url_to_external_blog_card($the_content) {
add_filter('widget_text_pc_text', 'url_to_external_blog_card', 11);
add_filter('widget_classic_text', 'url_to_external_blog_card', 11);
add_filter('widget_text_mobile_text', 'url_to_external_blog_card', 11);
add_filter('the_category_content', 'url_to_external_blog_card', 11);
add_filter('the_tag_content', 'url_to_external_blog_card', 11);
add_filter('the_category_tag_content', 'url_to_external_blog_card', 11);
}


Expand Down
3 changes: 1 addition & 2 deletions lib/html5.php
Expand Up @@ -13,8 +13,7 @@
add_filter('widget_text_pc_text', 'theme_html5_fix');
add_filter('widget_classic_text', 'theme_html5_fix');
add_filter('widget_text_mobile_text', 'theme_html5_fix');
add_filter('the_category_content', 'theme_html5_fix');
add_filter('the_tag_content', 'theme_html5_fix');
add_filter('the_category_tag_content', 'theme_html5_fix');
if ( !function_exists( 'theme_html5_fix' ) ):
function theme_html5_fix($the_content){
//</div>に</p></div>が追加されてしまう
Expand Down
6 changes: 2 additions & 4 deletions lib/image.php
Expand Up @@ -25,8 +25,7 @@ function is_lightbox_plugin_exist($content){
//画像リンクのAタグをLightboxに対応するように付け替え
if ( is_lightbox_effect_enable() ) {
add_filter( 'the_content', 'add_lightbox_property', 9 );
add_filter( 'the_category_content', 'add_lightbox_property', 9 );
add_filter( 'the_tag_content', 'add_lightbox_property', 9 );
add_filter( 'the_category_tag_content', 'add_lightbox_property', 9 );
}
if ( !function_exists( 'add_lightbox_property' ) ):
function add_lightbox_property( $content ) {
Expand All @@ -53,8 +52,7 @@ function add_lightbox_property( $content ) {
//http://sorgalla.com/lity/
if ( is_lity_effect_enable() ) {
add_filter( 'the_content', 'add_lity_property', 11 );
add_filter( 'the_category_content', 'add_lity_property', 11 );
add_filter( 'the_tag_content', 'add_lity_property', 11 );
add_filter( 'the_category_tag_content', 'add_lity_property', 11 );
}
if ( !function_exists( 'add_lity_property' ) ):
function add_lity_property( $content ) {
Expand Down
3 changes: 1 addition & 2 deletions lib/links.php
Expand Up @@ -25,8 +25,7 @@ function is_anchor_link_tag_blogcard($anchor_link_tag){
add_filter('widget_text_pc_text', 'replace_anchor_links', 12);
add_filter('widget_classic_text', 'replace_anchor_links', 12);
add_filter('widget_text_mobile_text', 'replace_anchor_links', 12);
add_filter('the_category_content', 'replace_anchor_links', 12);
add_filter('the_tag_content', 'replace_anchor_links', 12);
add_filter('the_category_tag_content', 'replace_anchor_links', 12);
if ( !function_exists( 'replace_anchor_links' ) ):
function replace_anchor_links($the_content) {
$res = preg_match_all('{<a [^>]+?>.+?</a>}is', $the_content, $m);
Expand Down
9 changes: 3 additions & 6 deletions lib/settings.php
Expand Up @@ -275,12 +275,9 @@ function add_excerpts_custom_init(){
add_filter('ranking_item_link_tag', 'do_shortcode');
//アピールリア
add_filter('appeal_area_message', 'do_shortcode');
//カテゴリページ
add_filter('the_category_content', 'do_shortcode');
add_filter('the_category_content', 'shortcode_unautop');
//タグページ
add_filter('the_tag_content', 'do_shortcode');
add_filter('the_tag_content', 'shortcode_unautop');
//カテゴリ・タグページ
add_filter('the_category_tag_content', 'do_shortcode');
add_filter('the_category_tag_content', 'shortcode_unautop');

//generator を削除
remove_action('wp_head', 'wp_generator');
Expand Down
3 changes: 1 addition & 2 deletions lib/ssl.php
Expand Up @@ -113,6 +113,5 @@ function chagne_site_url_html_to_https($the_content){
//add_filter('widget_classic_text', 'chagne_site_url_html_to_https', 1);
add_filter('widget_text_mobile_text', 'chagne_site_url_html_to_https', 1);
add_filter('comment_text', 'chagne_site_url_html_to_https', 1);
add_filter('the_category_content', 'chagne_site_url_html_to_https', 1);
add_filter('the_tag_content', 'chagne_site_url_html_to_https', 1);
add_filter('the_category_tag_content', 'chagne_site_url_html_to_https', 1);
}

0 comments on commit 944342f

Please sign in to comment.