wp_refresh_metabox_loader_nonces
函数
wp_refresh_metabox_loader_nonces ( $response, $data )
- 参数
-
-
(array)
$response
The Heartbeat response.- Required: 是
-
(array)
$data
The $_POST data sent.- Required: 是
-
(array)
- 返回值
-
- (array) The Heartbeat response.
- 定义位置
-
-
wp-admin/includes/misc.php
, line 1267
-
wp-admin/includes/misc.php
- 引入
- 6.1.0
- 弃用
- –
刷新用于区块编辑器中元组框的非对称性。
function wp_refresh_metabox_loader_nonces( $response, $data ) { if ( empty( $data['wp-refresh-metabox-loader-nonces'] ) ) { return $response; } $received = $data['wp-refresh-metabox-loader-nonces']; $post_id = (int) $received['post_id']; if ( ! $post_id ) { return $response; } if ( ! current_user_can( 'edit_post', $post_id ) ) { return $response; } $response['wp-refresh-metabox-loader-nonces'] = array( 'replace' => array( 'metabox_loader_nonce' => wp_create_nonce( 'meta-box-loader' ), '_wpnonce' => wp_create_nonce( 'update-post_' . $post_id ), ), ); return $response; }
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。