Skip to content

Commit

Permalink
必須バージョンの更新
Browse files Browse the repository at this point in the history
設定されていても検索結果で検索フォームがでない問題の修正
設定しなくても常に表示されている為に「検索キーワード未入力時のフォーム内検索を許可」オプション機能の削除
  • Loading branch information
kmix-39 authored and Futai Shiica committed Mar 10, 2022
1 parent 59b072b commit a7daf1f
Show file tree
Hide file tree
Showing 8 changed files with 61 additions and 102 deletions.
6 changes: 0 additions & 6 deletions App/Admin/Options.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ function( $_option ) {
'linkage-wc-regist' => false,
'linkage-wc-lostpass' => false,
'is-use-advance-search' => false,
'always-display-search-form' => false,
'result-display-search-form' => false,
'display-alert-no-keyword' => false,
];
Expand Down Expand Up @@ -209,10 +208,6 @@ function() {
__( 'Expand the search form display', 'ktpp-bbpress-enhance' ),
function() {
?>
<p>
<input name="ktpp-bbpress-enhance[always-display-search-form]" id="_always-display-search-form" type="checkbox" value="1"<?php checked( 1, Helper::get_settings_value( 'always-display-search-form', false ) ); ?>>
<label for="_always-display-search-form"><?php esc_html_e( 'Displays the search form even if the search result does not exist.', 'ktpp-bbpress-enhance' ); ?></label>
</p>
<p>
<input name="ktpp-bbpress-enhance[result-display-search-form]" id="_result-display-search-form" type="checkbox" value="1"<?php checked( 1, Helper::get_settings_value( 'result-display-search-form', false ) ); ?>>
<label for="_result-display-search-form"><?php esc_html_e( 'Display a search form on the search results page.', 'ktpp-bbpress-enhance' ); ?></label>
Expand All @@ -230,7 +225,6 @@ function() {
?>
<input name="ktpp-bbpress-enhance[display-alert-no-keyword]" id="_display-alert-no-keyword" type="checkbox" value="1"<?php checked( 1, Helper::get_settings_value( 'display-alert-no-keyword', false ) ); ?>>
<label for="_display-alert-no-keyword"><?php esc_html_e( 'Display an alert "Please enter a search keyword."', 'ktpp-bbpress-enhance' ); ?></label>
<p class="description"><?php esc_html_e( 'This feature will not be enabled if "Allow searches with no input" is allowed.', 'ktpp-bbpress-enhance' ); ?></p>
<?php
},
'ktpp-bbpress-enhance',
Expand Down
8 changes: 4 additions & 4 deletions App/Definition/Active.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
class Active {

const THEME_SNOW_MONKEY = [
'snow-monkey' => '14.0.2',
'snow-monkey/resources' => '14.0.2',
'snow-monkey' => '16.2.0',
'snow-monkey/resources' => '16.2.0',
];

const PLUGIN_BBPRESS = [
'bbpress/bbpress.php' => '2.6.6',
'snow-monkey-bbpress-support/snow-monkey-bbpress-support.php' => '0.12.4',
'bbpress/bbpress.php' => '2.6.9',
'snow-monkey-bbpress-support/snow-monkey-bbpress-support.php' => '0.15.4',
];

}
3 changes: 0 additions & 3 deletions App/Part/AdvanceForumSearch/Bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ static function _enqueue_scripts_ktpp_bbpress_enhance() {
$_is_load |= bbp_is_forum_archive() || bbp_is_topic_archive() || bbp_is_topic_tag();
// 検索キーワードを入力されていない場合、検索が見つからない場合
$_is_load |= ( bbp_is_search() && ! bbp_has_search_results() && ! bbp_get_search_terms() );
// 検索結果がない場合でもフォームを出す場合
Helper::get_settings_value( 'always-display-search-form', false ) &&
$_is_load |= ( bbp_is_search() && ! bbp_has_search_results() );
// 検索結果一覧でフォームが有効な場合
Helper::get_settings_value( 'result-display-search-form', false ) &&
$_is_load |= ( bbp_is_search() );
Expand Down
10 changes: 1 addition & 9 deletions App/Part/TermsSearchForm/Bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,9 @@ function __construct() {
0
);

Helper::get_settings_value( 'always-display-search-form', false ) &&
add_action(
'bbp_template_after_search_results',
[ __CLASS__, '_bbp_template_after_search_results' ],
10,
0
);

Helper::get_settings_value( 'result-display-search-form', false ) &&
add_filter(
'snow_monkey_pre_template_part_render_template-parts/content/entry/content/content',
'snow_monkey_pre_template_part_render_template-parts/archive/entry/content/bbpress',
[ __CLASS__, '_render_bbp_search_form_before_results' ],
10,
3
Expand Down
1 change: 1 addition & 0 deletions App/View/bbPress/form-search-advance.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
defined( 'ABSPATH' ) || exit;

use KTPP\bbPressEnhance\App\Common\Helper;

if ( bbp_allow_search() ) :
?>
<div class="bbp-search-form">
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
],
"require": {
"php": ">=7.0",
"inc2734/wp-github-plugin-updater": "^3.1.1",
"inc2734/wp-github-plugin-updater": "^3.1.2",
"inc2734/wp-plugin-view-controller": "^1.1.1"
},
"autoload": {
Expand Down
Binary file modified languages/ktpp-bbpress-enhance-ja.mo
Binary file not shown.
Loading

0 comments on commit a7daf1f

Please sign in to comment.