[-] Dump all actions and filters run

This is for debugging, but it’s helpful, so sharing here in case someone needs it.
Do not share with clients.

Add it to a theme’s function.php and load any page, or perform any action (for example you can die() a cred_save_data() to see what’s hooked in this moment, etc). Scroll to the bottom of the page to see the hooked actions and filters.

class MyTracker {

  static $hooks;

  static function track_hooks( ) {
    $filter = current_filter();
    if ( ! empty($GLOBALS['wp_filter'][$filter]) ) {
      foreach ( $GLOBALS['wp_filter'][$filter] as $priority => $tag_hooks ) {
        foreach ( $tag_hooks as $hook ) {
          if ( is_array($hook['function']) )  {
            if ( is_object($hook['function'][0]) ) {
              $func = get_class($hook['function'][0]) . '->' . $hook['function'][1];
            } elseif ( is_string($hook['function'][0]) ) {
              $func = $hook['function'][0] . '::' . $hook['function'][1];
            }
          } elseif( $hook['function'] instanceof Closure ) {
            $func = 'a closure';
          } elseif( is_string($hook['function']) ) {
            $func = $hook['function'];
          }
          self::$hooks[] = 'On hook "' . $filter . '" run '. $func . ' at priority ' . $priority;
        }
      }
    }
  }

}

add_action( 'all', array('MyTracker', 'track_hooks') );

add_action( 'shutdown', function() {
    echo implode( '
', MyTracker::$hooks ); }, 9999);

[-] How to read a site’s debug information written in a plain text reply

If a client adds their site debug information in the standard forum reply field instead of the debug info field, it’s difficult to read. I’ve seen other supporters reply something like “I wasn’t able to read your debug information, can you resubmit it?” I would like to avoid that. The debug information is a JSON object…there’s nothing proprietary or special about it. Instead of waiting for the client to resubmit it correctly, reformat the data yourself and read everything that would normally be available in the debug information panel.

If you’re not familiar with the JSON format, you can use any JSON editor tool to convert the jumbled text into a more organized display. An online JSON editor tool like jsoneditoronline.org would be perfect. Copy the debug text from the forum reply, then paste it in the left side of the screen. Click the right arrow button between the left and right panels, and the parsed information will be formatted into a data tree on the right side. Use the toggles to expand and contract each key or array item.

Pro tip – with the browser developer tools active, you don’t need another tool. The browser console can interpret JSON and format it for you, right there in the forum.

  1. Copy the debug information text from the forum reply.
  2. Open the browser JavaScript console.
  3. Type debug = then paste the debug text by typing Command + v or CTRL + v
  4. Press Return and the console will return a formatted debug object in the next line.
  5. Click the toggle arrow icon to twirl open the object inspector:
> {core: {…}, plugins: {…}, theme: {…}, extra-debug: {…}}

You have a nicely formatted debug information object right there in the browser console. All the information you would normally see – WordPress, the Server, PHP information, plugins and themes – is available here. It’s faster than waiting for the client to respond, and you don’t even have to leave the forum page or open a new tab to use some external tool.

Bring back old Toolset Menu, and have Layouts Edit Button as well if layouts is assigned to content

The Toolset Menu in the Front End WP Admin Bar, if Layouts is assigend to the content, becomes leads to the Front End Editor of layouts.
You cannot access other Toolset items with it anymore.

Often Clients have nested Views and to quickly access them, the old menu was perfect.
The new way will introduce a lot of time wasted clicking around in the admin.

To those clients we can provide a filter that brings back the old Toolset Menu.

It is also very useful for debugging.

add_filter('toolset_filter_toolset_admin_bar_menu_disable', 'my_layout_menu');
function my_layout_menu(){
	return false;
}