SHOW:
|
|
- or go back to the newest paste.
1 | // parent's theme class | |
2 | class MyThemeClass{ | |
3 | - | public function add_actions(){ |
3 | + | |
4 | public function add_filter(){ | |
5 | add_action("excerpt_length", array($this, "filter_excerpt_length")); | |
6 | } | |
7 | - | } |
7 | + | |
8 | public function filter_excerpt_length($length){ | |
9 | return 50; | |
10 | } | |
11 | } | |
12 | $desktop_theme = MyThemeClass; | |
13 | ||
14 | // child theme's class | |
15 | class MyChildThemeClass extends MyThemeClass{ | |
16 | ||
17 | public function add_filter(){ | |
18 | add_action("excerpt_length", array($this, "filter_excerpt_length")); | |
19 | } | |
20 | ||
21 | public function filter_excerpt_length($length){ | |
22 | return 20; | |
23 | } | |
24 | } | |
25 | $child_theme = MyChildThemeClass; |