wordpress检查
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了wordpress检查相关的知识,希望对你有一定的参考价值。
function save_taxonomy_data($post_id) { // verify this came from our screen and with proper authorization. if ( !wp_verify_nonce( $_POST['taxonomy_noncename'], 'taxonomy_theme' )) { return $post_id; } // verify if this is an auto save routine. If it is our form has not been submitted, so we dont want to do anything return $post_id; // Check permissions if ( 'page' == $_POST['post_type'] ) { if ( !current_user_can( 'edit_page', $post_id ) ) return $post_id; } else { if ( !current_user_can( 'edit_post', $post_id ) ) return $post_id; } // OK, we're authenticated: we need to find and save the data $post = get_post($post_id); if (($post->post_type == 'post') || ($post->post_type == 'page')) { // OR $post->post_type != 'revision' $theme = $_POST['post_theme']; wp_set_object_terms( $post_id, $theme, 'theme' ); } return $theme; }
以上是关于wordpress检查的主要内容,如果未能解决你的问题,请参考以下文章
wordpress:如何检查 slug 是不是包含特定单词?
Wordpress - 通过检查用户状态从 bbPress 外部更改论坛角色