Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // parent's theme class
- class MyThemeClass{
- public function add_filter(){
- add_action("excerpt_length", array($this, "filter_excerpt_length"));
- }
- public function filter_excerpt_length($length){
- return 50;
- }
- }
- $desktop_theme = MyThemeClass;
- // child theme's class
- class MyChildThemeClass extends MyThemeClass{
- public function add_filter(){
- add_action("excerpt_length", array($this, "filter_excerpt_length"));
- }
- public function filter_excerpt_length($length){
- return 20;
- }
- }
- $child_theme = MyChildThemeClass;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement