Advertisement
Guest User

Untitled

a guest
Apr 26th, 2013
324
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.82 KB | None | 0 0
  1. <?php
  2.  
  3. /*
  4.  *  This function will display a pretty list of the widgets currently
  5.  *  included by Jetpack. Note that it stops WordPress execution
  6.  *  at this stage.
  7.  */
  8. add_filter( 'jetpack_widgets_to_include', 'list_jetpack_widgets' );
  9.  
  10. function list_jetpack_widgets( $widgets ) {
  11.     ?><pre><?php print_r( $widgets ); ?></pre><?php
  12.     exit;
  13. }
  14.  
  15. /*
  16.  *  This function removes the Facebook Likebox from the list of widgets
  17.  *  that Jetpack includes.
  18.  */
  19. add_filter( 'jetpack_widgets_to_include', 'filter_jetpack_widgets' );
  20.  
  21. function filter_jetpack_widgets( $widgets ) {
  22.     if ( ! is_array( $widgets ) )
  23.         return;
  24.    
  25.     $filtered_widgets = array();
  26.    
  27.     foreach ( $widgets as $widget ) {
  28.         if ( stristr( $widget, 'facebook-likebox.php' ) )
  29.             continue;
  30.            
  31.         $filtered_widgets[] = $widget;
  32.     }
  33.    
  34.     return $filtered_widgets;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement