-
Notifications
You must be signed in to change notification settings - Fork 1
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
[ 石川さん確認待ち / 2人目確認待ち ][ No index ] 検索エンジンがサイトをインデックスしないようにする にチェックが入ってたらアラートを出す機能を追加 #1173
base: master
Are you sure you want to change the base?
Conversation
… dashboard if "Discourage search engines from indexing this site" is enabled in Settings > Reading.
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.
以下を確認しました。
- ダッシュボードのホーム(/wp-admin/index.php)でのみアラートが表示されていることが確認できました。
- 設定 > 表示設定 > 検索エンジンがサイトをインデックスしない にチェックを入れるとアラートが表示され、チェックを外すとアラート表示が消えました。
- アラートの閉じる(×)ボタンを押すとアラートが消えることが確認できました。
@kurudrive
動作には問題ありませんが、一度以下のご確認をお願いいたします🙇
(function($){ | ||
$(document).on("click", ".notice-dismiss", function(){ | ||
$(this).closest(".notice").fadeOut(); | ||
}); | ||
})(jQuery); | ||
</script>'; |
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.
すみません、、AIでコードレビューをしたところ、以下の回答がありました。
回答通りに該当の箇所を削除したところ、閉じるボタンは動くようで問題なさそうでした。
しかしながら、プロジェクト統一の書き方もあると思いますので、さらっと見ていただき検討していただけますと良いかなとおもいました。
WordPressのダッシュボードでは、.notice-dismissボタンの機能は既にWordPressコアによって自動的に処理されています。そのため、以下のjQueryコードは不要です。
echo '<script type="text/javascript">
(function($){
$(document).on("click", ".notice-dismiss", function(){
$(this).closest(".notice").fadeOut();
});
})(jQuery);
</script>';
WordPress の標準の is-dismissible クラスを使う場合は、手動で を追加する必要はなく、WordPress が自動的に閉じるボタンを追加して処理します。以下のコードは不要です。
echo '<button type="button" class="notice-dismiss"><span class="screen-reader-text">' . __( 'Dismiss this notice.', 'vk-all-in-one-expansion-unit' ) . '</span></button>';
チケットへのリンク / 変更の理由(元のissueがあればリンクを貼り付ければOK)
どういう変更をしたか?
実装者はレビュワーに回す前に以下の事を確認してチェックをつけてください。
ソースコードについて
デザイン・UI
プログラムの変更の場合
テストを書かないのは普通ではありません。書けるテストは極力書くようにしてください。
書いていない場合は書かない理由を記載してください。
その他
変更内容について何を確認したか、どういう方法で確認をしたかなど