Performance: Hook priority and arguments
MEDIUM IMPACT
This concept affects how quickly and efficiently WordPress executes hooked functions during page load and user interactions.
add_action('init', 'light_function', 5, 1); function light_function($a) { // simple logic }
add_action('init', 'heavy_function', 10, 5); function heavy_function($a, $b, $c, $d, $e) { // complex logic }
| Pattern | Function Calls | Arguments Processed | Execution Delay | Verdict |
|---|---|---|---|---|
| Default priority (10) with many args | Many | Many | Higher delay | [X] Bad |
| Lower priority number (5) with fewer args | Fewer | Few | Lower delay | [OK] Good |