Skip to content

Instantly share code, notes, and snippets.

@hellofromtonya
Created February 3, 2018 23:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hellofromtonya/a0984025934a5122ccfdbc6345fb8cae to your computer and use it in GitHub Desktop.
Save hellofromtonya/a0984025934a5122ccfdbc6345fb8cae to your computer and use it in GitHub Desktop.
Original Beans v1.4.0 beans_replace_action() and beans_replace_action_hook() have a bug.
<?php
function beans_replace_action( $id, $hook = null, $callback = null, $priority = null, $args = null ) {
$action = array(
'hook' => $hook,
'callback' => $callback,
'priority' => $priority,
'args' => $args,
);
// Set and get the latest replaced.
$action = _beans_merge_action( $id, array_filter( $action ), 'replaced' );
// Set and get the latest added.
$action = _beans_merge_action( $id, $action, 'added' );
return beans_modify_action( $id, $hook, $callback, $priority, $args );
}
function beans_replace_action_hook( $id, $hook ) {
return beans_replace_action( $id, $hook );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment