-
-
Save tommcfarlin/a7d8704031124c0558b4 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 | |
/** | |
* Determines if the user has permission to save the information from the submenu | |
* page. | |
* | |
* @since 1.0.0 | |
* @access private | |
* | |
* @param string $action The name of the action specified on the submenu page | |
* @param string $nonce The nonce specified on the submenu page | |
* | |
* @return bool True if the user has permission to save; false, otherwise. | |
*/ | |
function acme_user_can_save( $action, $nonce ) { | |
$is_nonce_set = isset( $_POST[ $nonce ] ); | |
$is_valid_nonce = false; | |
if ( $is_nonce_set ) { | |
$is_valid_nonce = wp_verify_nonce( $_POST[ $nonce ], $action ); | |
} | |
return ( $is_nonce_set && $is_valid_nonce ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What changes i should mad in code for page created under custom post type, means edit.php?post_type="my_custom_post_type"