Automattic / Automattic/VIP-Coding-Standards

Improve flush_rewrite_rules warning

オープン
#701 コメント 1 件 リアクション 4 件 担当者 0 名 GitHub で見る
Type: Enhancement
主要言語
PHP
スター
261
フォーク
44
平均マージ
19分
マージ済み PR(30日)
1

説明

## What problem would the enhancement address for VIP?

Right now here's the rule that we see when you try to use `flush_rewrite_rules()`:

> 🚫 Error( severity 5 ): flush_rewrite_rules should not be used in any normal circumstances in the theme code (WordPressVIPMinimum.Functions.RestrictedFunctions.flush_rewrite_rules_flush_rewrite_rules).

I feel like adding more context here as to "why" would be helpful, and also adding cases where this might be appropriate? For example, what about in a plugin activation/deactivation hook?

## Describe the solution you'd like

1. Why should you not use it
2. When it might be ok to use
3. What the effect of using it would have
4. Link to a doc on docs.wpvip.com to more details

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

flush_rewrite_rules に関する警告を出力する PHP_CodeSniffer ルールを特定し、既存のメッセージと関連ドキュメントを確認します。関数が推奨されない理由、アクティベーションフックまたはデアクティベーションフックが適切な場合、その影響、および関連する docs.wpvip.com のリンクを説明するように警告を更新します。ルールのテストが存在する場合は確認します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
php, wordpress
領域
documentation, tooling
issue の種類
機能追加
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。