Skip to content

Instantly share code, notes, and snippets.

@kimaldis
Created January 20, 2019 07:57
Show Gist options
  • Save kimaldis/90a56e31acc3f05db6f3dca850be0fba to your computer and use it in GitHub Desktop.
Save kimaldis/90a56e31acc3f05db6f3dca850be0fba to your computer and use it in GitHub Desktop.
Pass parameters to Wordpress actions & filters. #wordpress,#parameters
// hacky sort of way to pass parameters into action functions
//
static function Action( $name, $value ) {
return function() use( $name, $value) {
Log( "vlaue", $name, $value );
};
}
static public function Add( $name, $value ) {
add_action( 'admin_head', self::Action( $name, $value ));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment