How to get all the predefined do_action() calls from an active theme

pre_ is a terrible prefix for this because it’s going to interfere with all of the WordPress internal hooks that are prefixed with pre_.

But if you want to get the name of all the actions and filters called on a certain page you can use the all hook which adds your callback to every hook. Obviously this is terribly expensive so you wouldn’t want to do it on a production server.

add_action( 'all', 'wpse_all_actions' );
function wpse_all_actions() {
  static $pre = [];
  $filter = current_filter();
  if( 'pre_' === substr( $filter, 0, 4 ) ) {
    $pre[] = $filter;
  }
  if( 'shutdown' === $filter ) {
    var_dump( $pre );
  }
}

error code: 523