Support » Plugin: Debug Bar Actions and Filters Addon » Fix for bug in version 0.1

  • Resolved Toby

    (@polyme)


    Hi there,

    Great little plugin, but it threw a fatal error (I think with a buddy press filter)

    I re-wrote the debug_bar_action_and_filters_addon_display_filters() function to fix this…

    function debug_bar_action_and_filters_addon_display_filters()
    {
    	global $wp_filter;
    
    	$output = "";
    	$output .= "<div class='hooks_listing_container'>";
    	$output .= "<h2 style='width:100%;'>List of Filter Hooks (with functions)</h2>";
    	$output .= "<ul style='list-style-type: square !important; padding-left: 20px !important;'>";
    	foreach ($wp_filter as $filter_key => $filter_val){
    
    		$output .= "
    <li><strong>". $filter_key . "</strong>";
    		$output .= "<ul style='list-style-type: square !important; padding-left: 20px !important;'>";
    		ksort($filter_val);
    		foreach ($filter_val as $priority => $functions) {
    
    			$output .= "</li>
    <li>Priority: ". $priority . "";
    			$output .= "<ul style='list-style-type: square !important; padding-left: 20px !important;'>";
    			foreach( $functions as $i => $single_function ){
    				if( is_string( $single_function['function'] ) )
    					$output .= "</li>
    <li>". $single_function['function'] . "</li>
    ";
    				elseif( is_array( $single_function['function'] ) &&  is_string( $single_function['function'][0] ) )
    					$output .= "
    <li>". $single_function['function'][0] . " -> " . $single_function['function'][1] . "</li>
    ";
    				elseif( is_array( $single_function['function'] ) &&  is_object( $single_function['function'][0] ) )
    					$output .= "
    <li>(object) " . get_class( $single_function['function'][0] ) . " -> " . $single_function['function'][1] ."</li>
    ";
    				else
    					$output .= "
    <li>
    <pre>" . var_export($single_function, true) . "</pre>
    </li>
    ";
    			}
    			$output .= "";
    			$output .= "";
    
    		}
    		$output .= "";
    		$output .= "";
    
    	}
    	$output .= "";
    	$output .= "</div>";
    
    	return $output;
    }

    http://wordpress.org/extend/plugins/debug-bar-actions-and-filters-addon/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Subharanjan

    (@subharanjan)

    Thanks Toby for the info and the fix. I will have a look at it and will get back to you. Thanks

    Old Profile

    (@nicolealleyinteractivecom)

    I, too, was getting a fatal error when viewing the filter hooks, and I am not using buddyPress. I copied Toby’s function to replace the existing one and now the filter hooks view works.

    Old Profile

    (@nicolealleyinteractivecom)

    The bottom portion of the fixed function does not close the open UL and LI tags. Code should be:

    }
    			$output .= "</ul>";
    			$output .= "</li>";
    
    		}
    		$output .= "</ul>";
    		$output .= "</li>";
    
    	}
    	$output .= "</ul>";
    	$output .= "</div>";
    
    	return $output;
    }

    Plugin Author Subharanjan

    (@subharanjan)

    @nicole: If possible, can you please give the list plugins, themes you are using for the setup where you are getting the fatal error. Actually, I am not getting the error at my end. It will be great help if you can provide me steps to reproduce the issue and I can fix and update the code.

    Thanks

    Plugin Author Subharanjan

    (@subharanjan)

    Fixed it on Version 0.11
    http://plugins.trac.wordpress.org/changeset/725052/

    Thanks Toby and Nicole.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Fix for bug in version 0.1’ is closed to new replies.