BBP_Topics_Admin:: attributes_metabox_save (inttopic_id美元)
传递要进行处理的主题属性
描述
参数
- topic_id美元
-
(int)(必需)主题id
返回
(int)父id
源
文件:bp-forums / admin / topics.php
Public function attributes_metabox_save($topic_id) {if ($this->bail())返回$topic_id;//保释如果做autosave if (define ('DOING_AUTOSAVE') && DOING_AUTOSAVE)返回$topic_id;//保释如果不是一个post请求if (!Bbp_is_post_request())返回$topic_id;// Nonce check if (empty($_POST['bbp_topic_metabox']) || !wp_verify_nonce($_POST['bbp_topic_metabox'], 'bbp_topic_metabox_save')) return $topic_id;//如果当前用户不能编辑此主题,则返回$topic_id;//获取论坛ID $forum_id = !empty($_POST['parent_id']) ?(int) $_POST['parent_id']: 0;//获取主题作者数据$anonymous_data = bbp_filter_anonymous_post_data();$author_id = bbp_get_topic_author_id($topic_id); $is_edit = (bool) isset( $_POST['save'] ); // Formally update the topic bbp_update_topic( $topic_id, $forum_id, $anonymous_data, $author_id, $is_edit ); // Stickies if ( !empty( $_POST['bbp_stick_topic'] ) && in_array( $_POST['bbp_stick_topic'], array( 'stick', 'super', 'unstick' ) ) ) { // What's the haps? switch ( $_POST['bbp_stick_topic'] ) { // Sticky in this forum case 'stick' : bbp_stick_topic( $topic_id ); break; // Super sticky in all forums case 'super' : bbp_stick_topic( $topic_id, true ); break; // Normal case 'unstick' : default : bbp_unstick_topic( $topic_id ); break; } } // Allow other fun things to happen do_action( 'bbp_topic_attributes_metabox_save', $topic_id, $forum_id ); do_action( 'bbp_author_metabox_save', $topic_id, $anonymous_data ); return $topic_id; }
更新日志
版本 | 描述 |
---|---|
bbPress (r2746) | 介绍了。 |