Last active
January 20, 2016 20:48
-
-
Save rfmeier/df9e0cdf23b497d90d11 to your computer and use it in GitHub Desktop.
Hook register_meta() into WordPress 'init'
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
<?php //* do not include php tag | |
add_action( 'init', 'register_my_sample_meta' ); | |
/** | |
* Callback for WordPress 'init' action. | |
* | |
* Register the post meta. | |
* | |
* @uses register_meta() | |
* @see https://codex.wordpress.org/Function_Reference/register_meta | |
* | |
* @return void | |
*/ | |
function register_my_sample_meta() { | |
register_meta( | |
'post', //* the post type | |
'sample_count', //* the meta key | |
'sanitize_sample_count_meta', //* the callable sanitize function | |
'auth_sample_count_meta' //* the optional authenticate function | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment