Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Apr 26th, 2013  |  syntax: PHP  |  size: 0.82 KB  |  views: 114  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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. }
clone this paste RAW Paste Data