wpseek.com
Uma área de pesquisa sobre o WordPress para devs e autores do tema
wp_refresh_post_nonces › WordPress Function
Desde3.6.0
Obsoleton/a
› wp_refresh_post_nonces ( $response, $data, $screen_id )
Parâmetros: (3) |
|
Retorna: |
|
Definido em: |
|
Codex: |
Checks nonce expiration on the New/Edit Post screen and refresh if needed.
Funções relacionadas: wp_refresh_post_lock, wp_refresh_heartbeat_nonces, wp_refresh_metabox_loader_nonces, wp_trash_post_comments, wp_ajax_rest_nonce
Fonte
function wp_refresh_post_nonces( $response, $data, $screen_id ) { if ( array_key_exists( 'wp-refresh-post-nonces', $data ) ) { $received = $data['wp-refresh-post-nonces']; $response['wp-refresh-post-nonces'] = array( 'check' => 1 ); $post_id = absint( $received['post_id'] ); if ( ! $post_id ) { return $response; } if ( ! current_user_can( 'edit_post', $post_id ) ) { return $response; } $response['wp-refresh-post-nonces'] = array( 'replace' => array( 'getpermalinknonce' => wp_create_nonce( 'getpermalink' ), 'samplepermalinknonce' => wp_create_nonce( 'samplepermalink' ), 'closedpostboxesnonce' => wp_create_nonce( 'closedpostboxes' ), '_ajax_linking_nonce' => wp_create_nonce( 'internal-linking' ), '_wpnonce' => wp_create_nonce( 'update-post_' . $post_id ), ), ); } return $response; }