| | 307 | |
| | 308 | /** |
| | 309 | * anonymous_metabox () |
| | 310 | * |
| | 311 | * Allows editing of information about an anonymous user |
| | 312 | * |
| | 313 | * @uses bbp_get_reply_author_id, add_meta_box, do_action |
| | 314 | * @since bbPress (r) |
| | 315 | * @return void |
| | 316 | */ |
| | 317 | |
| | 318 | function anonymous_metabox () { |
| | 319 | global $bbp; |
| | 320 | |
| | 321 | if ( 0 != bbp_get_reply_author_id( (int) $_GET['post'] ) ) |
| | 322 | return true; |
| | 323 | |
| | 324 | add_meta_box ( |
| | 325 | 'bbp_anonymous_metabox', |
| | 326 | __( 'Anonymous Information', 'bbpress'), |
| | 327 | 'bbp_anonymous_metabox', |
| | 328 | $bbp->topic_id, |
| | 329 | 'normal' |
| | 330 | ); |
| | 331 | |
| | 332 | add_meta_box ( |
| | 333 | 'bbp_anonymous_metabox', |
| | 334 | __( 'Anonymous Information', 'bbpress'), |
| | 335 | 'bbp_anonymous_metabox', |
| | 336 | $bbp->reply_id, |
| | 337 | 'normal' |
| | 338 | ); |
| | 339 | |
| | 340 | do_action('bbp_anonymous_metabox'); |
| | 341 | } |
| | 342 | |
| | 343 | /** |
| | 344 | * anonymous_metabox_save () |
| | 345 | * |
| | 346 | * Saves all of the anonymous information about an anonymous user. |
| | 347 | * |
| | 348 | * @param int $post_id |
| | 349 | * @return void |
| | 350 | * @since bbPress (r) |
| | 351 | */ |
| | 352 | |
| | 353 | function anonymous_metabox_save ( $post_id ) { |
| | 354 | if( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) |
| | 355 | return $post_id; |
| | 356 | |
| | 357 | if( !current_user_can( 'edit_post', $post_id ) ) |
| | 358 | return $post_id; |
| | 359 | |
| | 360 | $filter = bbp_filter_anonymous_post_data(); |
| | 361 | |
| | 1193 | * bbp_anonymous_metabox () |
| | 1194 | * |
| | 1195 | * metabox for anonymous poster |
| | 1196 | * |
| | 1197 | * @package bbPress |
| | 1198 | * @since bbPress (r) |
| | 1199 | * @global object $post, object $bbp |
| | 1200 | */ |
| | 1201 | function bbp_anonymous_metabox () { |
| | 1202 | global $post, $bbp; |
| | 1203 | |
| | 1204 | ?> |
| | 1205 | <p><strong><?php _e('Name', 'bbpress'); ?></strong></p> |
| | 1206 | <label class="screen-reader-text" for="parent_id"><?php _e('Name', 'bbpress'); ?></label> |
| | 1207 | <input type="text" name="bbp_anonymous_name" value="<?php echo get_post_meta($post->ID, '_bbp_anonymous_name', true); ?>" size="38" /></label> |
| | 1208 | <p><strong><?php _e('Email', 'bbpress'); ?></strong></p> |
| | 1209 | <label class="screen-reader-text" for="parent_id"><?php _e('Email', 'bbpress'); ?></label> |
| | 1210 | <input type="text" name="bbp_anonymous_email" value="<?php echo get_post_meta($post->ID, '_bbp_anonymous_email', true); ?>" size="38" /></label> |
| | 1211 | <p><strong><?php _e('Website', 'bbpress'); ?></strong></p> |
| | 1212 | <label class="screen-reader-text" for="parent_id"><?php _e('Email', 'bbpress'); ?></label> |
| | 1213 | <input type="text" name="bbp_anonymous_website" value="<?php echo get_post_meta($post->ID, '_bbp_anonymous_website', true); ?>" size="38" /></label> |
| | 1214 | <br /> |
| | 1215 | <p>IP Address: <?php echo get_post_meta($post->ID, '_bbp_anonymous_ip', true); ?></p> |
| | 1216 | <?php |
| | 1217 | } |
| | 1218 | |
| | 1219 | |
| | 1220 | /** |