Automattic / Automattic/VIP-Coding-Standards

Improve flush_rewrite_rules warning

Aperta
#701 1 commento 4 reazioni 0 assegnatari Vedi su GitHub
Type: Enhancement
Lingua principale
PHP
Stelle
261
Fork
44
Merge medio
19m
PR unite (30g)
1

Descrizione

## 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

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Individua la regola PHP_CodeSniffer che emette l’avviso relativo a flush_rewrite_rules e rivedi il messaggio esistente e la documentazione correlata. Aggiorna l’avviso per spiegare perché la funzione è sconsigliata, quando gli hook di attivazione o disattivazione possono essere appropriati, i suoi effetti e il link pertinente a docs.wpvip.com; verifica i test della regola, se presenti.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
php, wordpress
Ambito
documentation, tooling
Tipo di issue
Funzionalità
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.