1 | <?php |
||
14 | class Frontend_Request extends Request { |
||
15 | /** |
||
16 | * Bootstrap. |
||
17 | * |
||
18 | * @return void |
||
19 | */ |
||
20 | public function __construct() { |
||
24 | |||
25 | /** |
||
26 | * Parse the current WordPress context around the $post global. |
||
27 | * |
||
28 | * Called by the `wp` hook. |
||
29 | * |
||
30 | * @param \WP $wp The WordPress environment class. Unused. |
||
31 | * |
||
32 | * @internal |
||
33 | * @return void |
||
34 | */ |
||
35 | public function parse( $wp = null ) { |
||
50 | |||
51 | /** |
||
52 | * Check if WordPress is_admin(), and make sure not DOING_AJAX. |
||
53 | * |
||
54 | * @todo load-(scripts|styles).php return true for \is_admin()! |
||
55 | * |
||
56 | * @api |
||
57 | * @since future |
||
58 | * |
||
59 | * @return bool Pure is_admin or not? |
||
60 | */ |
||
61 | 1 | public function is_admin() { |
|
65 | } |
||
66 |
The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.
The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.
To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.