Advertisement
Guest User

Untitled

a guest
Nov 29th, 2013
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // parent's theme class
  2. class MyThemeClass{
  3.    
  4.     public function add_filter(){
  5.         add_action("excerpt_length", array($this, "filter_excerpt_length"));
  6.     }
  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;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement