Last active
December 28, 2017 22:50
-
-
Save Shelob9/d2b082c3c868136ef733adc888e63252 to your computer and use it in GitHub Desktop.
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 | |
register_meta('user', 'xp', | |
[ | |
'sanitize_callback' => 'absint', | |
] | |
); |
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 | |
register_meta('user', 'xp', | |
[ | |
'sanitize_callback' => 'absint', | |
'show_in_rest' => true, | |
] | |
); |
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 | |
register_meta('user', 'xp', | |
[ | |
'sanitize_callback' => 'absint', | |
'show_in_rest' => true, | |
'type' => 'integer', | |
'description' => 'The total experience points earned by this user, as a positive integer', | |
] | |
); |
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 | |
register_meta('user', 'xp', | |
[ | |
'sanitize_callback' => 'absint', | |
'show_in_rest' => true, | |
'type' => 'integer', | |
'description' => 'The total experience points earned by this user, as a positive integer', | |
'auth_callback' => function(){ | |
return current_user_can( 'some-cap' ); | |
} | |
] | |
); |
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 | |
register_meta( 'user', 'xp', 'absint' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment