1 | <?php |
||
6 | class Jetpack_Shortcode_Unavailable { |
||
7 | /** |
||
8 | * Set up the actions and filters for the class to listen to. |
||
9 | * |
||
10 | * @param array $shortcodes An associative array of keys being the shortcodes that are unavailable, and a string explaining why. |
||
11 | */ |
||
12 | public function __construct( $shortcodes ) { |
||
17 | |||
18 | /** |
||
19 | * For all of our defined unavailable shortcodes, if something else hasn't |
||
20 | * already claimed them, add a handler to nullify their output. |
||
21 | */ |
||
22 | public function add_shortcodes() { |
||
29 | |||
30 | /** |
||
31 | * Nullify the output of unavailable shortcodes. Includes a filter to make |
||
32 | * it easier to notify admins that a shortcode that they used is unavailable. |
||
33 | * |
||
34 | * @param $atts |
||
35 | * @param string $content |
||
36 | * @param string $shortcode |
||
37 | * @return mixed|void |
||
38 | */ |
||
39 | public function stub_shortcode( $atts, $content = '', $shortcode = '' ) { |
||
58 | } |
||
59 | |||
63 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: