Advertisement
Guest User

Untitled

a guest
Dec 1st, 2015
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. add_filter( 'cherry_current_object_context', 'foo', 11, 2 );
  2. function foo( $context, $id ) {
  3.  
  4. if ( is_search() ) {
  5. return 'search';
  6. }
  7.  
  8. return $context;
  9. }
  10.  
  11. add_filter( 'cherry_current_object_has_meta', 'bar', 11, 4 );
  12. function bar( $meta, $context, $id, $key ) {
  13.  
  14. if ( 'search' !== $context ) {
  15. return $meta;
  16. }
  17.  
  18. if ( 'cherry_grid_type' === $key ) {
  19. return array(
  20. 'header' => 'default-grid-type',
  21. 'content' => 'wide',
  22. 'footer' => 'default-grid-type',
  23. );
  24. }
  25.  
  26. if ( 'cherry_layout' === $key ) {
  27. return 'sidebar-sidebar-content';
  28. }
  29.  
  30. return $meta;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement