Created
January 20, 2019 07:57
-
-
Save kimaldis/90a56e31acc3f05db6f3dca850be0fba to your computer and use it in GitHub Desktop.
Pass parameters to Wordpress actions & filters. #wordpress,#parameters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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