-
Notifications
You must be signed in to change notification settings - Fork 47
【ご要望】新着記事、人気記事、新着情報にコメント数を表示するオプションの追加 #310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
yhira
merged 13 commits into
xserver-inc:master
from
xs-stakazawa:fix/takazawa/add-option-display-comment-count
Nov 19, 2025
+38,101
−9
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
b749384
新着記事、人気記事、新着情報にコメント数を表示するオプションの追加のためのlib/shortcodes.phpのコードを調整
xs-stakazawa 9c9c083
コメント機能追加のための出力コード等を調整
xs-stakazawa 20db21d
新着記事、人気記事、新着情報のそれぞれのブロックにコメント数表示機能を追加+CSS調整等
xs-stakazawa 1530840
コメント数部分のHTMLクラス名の調整+CSSにてレイアウト調整
xs-stakazawa dd36ac1
インデントのみの変更を戻し
xs-stakazawa ed6e3a1
HTMLタグの出力制御+コードを簡潔にリファクタリング
xs-stakazawa 0c94101
コードを既存の状態に戻す
xs-stakazawa 5faed0a
widget_entry_card_date_beforeフック使用時のレイアウトの調整
xs-stakazawa f55bed6
Revert "widget_entry_card_date_beforeフック使用時のレイアウトの調整"
xs-stakazawa 829c414
widget_entry_card_date_beforeフックの場所を調整
xs-stakazawa 04808b3
新着記事にて投稿IDで処理を振り分けられるように調整
xs-stakazawa 45b7b90
新着記事ブロックでの「コメント数を表示する」の位置を調整
xs-stakazawa 742577d
既存のレイアウトと差分を無くすためCSS微調整
xs-stakazawa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| <?php return array('dependencies' => array('lodash', 'react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-keycodes', 'wp-primitives', 'wp-rich-text'), 'version' => '9170b8f56ec55d77b928'); | ||
| <?php return array('dependencies' => array('lodash', 'react', 'react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-keycodes', 'wp-primitives', 'wp-rich-text'), 'version' => '00f20c3925f2a5f21758'); |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -1003,6 +1003,7 @@ function generate_popular_entries_tag($atts){ | |||||||||||||
| 'post_type' => 'post', | ||||||||||||||
| 'horizontal' => 0, | ||||||||||||||
| 'action' => null, | ||||||||||||||
| 'comment' => 0, | ||||||||||||||
| ), $atts, 'generate_popular_entries_tag')); | ||||||||||||||
|
|
||||||||||||||
| //Swiperスクリプトコードを呼び出すかどうか | ||||||||||||||
|
|
@@ -1052,7 +1053,6 @@ function generate_popular_entries_tag($atts){ | |||||||||||||
| } else { | ||||||||||||||
| $post_thumbnail_img = get_original_image_tag($no_thumbnail_url, $w, $h, 'no-image popular-entry-card-thumb-no-image widget-entry-card-thumb-no-image', ''); | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| //スニペット表示 | ||||||||||||||
| $snippet_tag = ''; | ||||||||||||||
| //「タイトルを重ねた大きなサムネイル」の時はスニペットを表示させない | ||||||||||||||
|
|
@@ -1085,7 +1085,15 @@ function generate_popular_entries_tag($atts){ | |||||||||||||
| <?php if ($entry_type != ET_LARGE_THUMB_ON): ?> | ||||||||||||||
| <?php echo $pv_tag; ?> | ||||||||||||||
| <?php endif ?> | ||||||||||||||
| <?php generate_widget_entry_card_date('popular', $post->ID, $display = $date); ?> | ||||||||||||||
| <?php do_action( 'widget_entry_card_date_before', 'popular', $post->ID); ?> | ||||||||||||||
| <div class="popular-entry-card-meta widget-entry-card-meta card-meta"> | ||||||||||||||
| <div class="popular-entry-card-info widget-entry-card-info card-info"> | ||||||||||||||
| <?php generate_widget_entry_card_date('popular', $post->ID, $display = $date); | ||||||||||||||
| if ($comment): ?> | ||||||||||||||
| <span class="popular-entry-card-comment widget-entry-card-comment card-comment post-comment-count"><span class="fa fa-comment-o comment-icon" aria-hidden="true"></span><?php echo get_comments_number( $post->ID ); ?></span> | ||||||||||||||
| <?php endif; ?> | ||||||||||||||
| </div> | ||||||||||||||
| </div> | ||||||||||||||
| </div><!-- /.popular-entry-content --> | ||||||||||||||
| <?php if ($entry_type == ET_LARGE_THUMB_ON): ?> | ||||||||||||||
| <?php echo $pv_tag; ?> | ||||||||||||||
|
|
@@ -1145,6 +1153,7 @@ function generate_widget_entries_tag($atts){ | |||||||||||||
| 'ex_posts' => null, | ||||||||||||||
| 'ex_cats' => null, | ||||||||||||||
| 'ordered_posts' => null, | ||||||||||||||
| 'comment' => 0, | ||||||||||||||
| ), $atts, 'generate_widget_entries_tag')); | ||||||||||||||
|
|
||||||||||||||
| //Swiperスクリプトコードを呼び出すかどうか | ||||||||||||||
|
|
@@ -1322,6 +1331,8 @@ function generate_widget_entries_tag($atts){ | |||||||||||||
| 'type' => $type, | ||||||||||||||
| 'horizontal' => $horizontal, | ||||||||||||||
| 'date' => $date, | ||||||||||||||
| 'comment' => $comment, | ||||||||||||||
| 'post_id' => get_the_ID(), | ||||||||||||||
| ); | ||||||||||||||
|
|
||||||||||||||
| if ($snippet) { | ||||||||||||||
|
|
@@ -1406,7 +1417,6 @@ function generate_widget_entry_card_date($prefix, $post_id = null, $display = fa | |||||||||||||
| // クラスのON/OFFを制御するオプション | ||||||||||||||
| $display_class = $display ? '' : ' display-none'; | ||||||||||||||
| ?> | ||||||||||||||
| <?php do_action( 'widget_entry_card_date_before', $prefix, $post_id); ?> | ||||||||||||||
| <div class="<?php echo $prefix; ?>-entry-card-date widget-entry-card-date<?php echo $display_class; ?>"> | ||||||||||||||
| <span class="<?php echo $prefix; ?>-entry-card-post-date widget-entry-card-post-date post-date"><span class="fa fa-clock-o" aria-hidden="true"></span><span class="entry-date"><?php echo get_the_time(get_site_date_format(), $post_id); ?></span></span><?php | ||||||||||||||
| //更新日の取得 | ||||||||||||||
|
|
@@ -1573,8 +1583,10 @@ function get_widget_entry_card_link_tag($atts){ | |||||||||||||
| 'classes' => null, | ||||||||||||||
| 'object' => 'post', | ||||||||||||||
| 'object_id' => null, | ||||||||||||||
| 'post_id' => null, | ||||||||||||||
| 'horizontal' => 0, | ||||||||||||||
| 'target' => null, | ||||||||||||||
| 'comment' => null, | ||||||||||||||
| ), $atts, 'get_widget_entry_card_link_tag')); | ||||||||||||||
|
|
||||||||||||||
| $class_text = null; | ||||||||||||||
|
|
@@ -1647,12 +1659,22 @@ function get_widget_entry_card_link_tag($atts){ | |||||||||||||
| <div class="<?php echo $prefix; ?>-entry-card-title widget-entry-card-title card-title"><?php echo $title;?></div> | ||||||||||||||
| <?php if ($snippet): ?> | ||||||||||||||
| <div class="<?php echo $prefix; ?>-entry-card-snippet widget-entry-card-snippet card-snippet"><?php echo $snippet; ?></div> | ||||||||||||||
| <?php endif; ?> | ||||||||||||||
| <?php endif; | ||||||||||||||
| if (!is_widget_navi_entry_card_prefix($prefix)) { | ||||||||||||||
| do_action( 'widget_entry_card_date_before', $prefix, $post_id); | ||||||||||||||
| } | ||||||||||||||
| ?> | ||||||||||||||
| <div class="<?php echo $prefix; ?>-entry-card-meta widget-entry-card-meta card-meta"> | ||||||||||||||
| <div class="<?php echo $prefix; ?>-entry-card-info widget-entry-card-info card-info"> | ||||||||||||||
| <?php | ||||||||||||||
| if (!is_widget_navi_entry_card_prefix($prefix)) { | ||||||||||||||
| generate_widget_entry_card_date($prefix, null, $display = $date); | ||||||||||||||
| } ?> | ||||||||||||||
|
|
||||||||||||||
| } | ||||||||||||||
| if ($comment): ?> | ||||||||||||||
| <span class="<?php echo $prefix; ?>-entry-card-comment widget-entry-card-comment card-comment post-comment-count"><span class="fa fa-comment-o comment-icon" aria-hidden="true"></span><?php echo get_comments_number(); ?></span> | ||||||||||||||
| <?php endif; ?> | ||||||||||||||
|
Comment on lines
+1673
to
+1675
|
||||||||||||||
| if ($comment): ?> | |
| <span class="<?php echo $prefix; ?>-entry-card-comment widget-entry-card-comment card-comment post-comment-count"><span class="fa fa-comment-o comment-icon" aria-hidden="true"></span><?php echo get_comments_number(); ?></span> | |
| <?php endif; ?> | |
| if ($comment): ?> | |
| <span class="<?php echo $prefix; ?>-entry-card-comment widget-entry-card-comment card-comment post-comment-count"><span class="fa fa-comment-o comment-icon" aria-hidden="true"></span><?php echo get_comments_number(); ?></span> | |
| <?php endif; ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The indentation for the PHP opening tag on line 1091 and the comment span on line 1092 is inconsistent with the surrounding code. The
if ($comment):statement and its content should align with thegenerate_widget_entry_card_datecall above it for better readability.