/includes/admin/metaboxes.php

  1. <?php 
  2.  
  3. /** 
  4. * bbPress Admin Metaboxes 
  5. * 
  6. * @package bbPress 
  7. * @subpackage Administration 
  8. */ 
  9.  
  10. /** Dashboard *****************************************************************/ 
  11.  
  12. /** 
  13. * bbPress Dashboard Right Now Widget 
  14. * 
  15. * Adds a dashboard widget with forum statistics 
  16. * 
  17. * @since bbPress (r2770) 
  18. * 
  19. * @uses bbp_get_version() To get the current bbPress version 
  20. * @uses bbp_get_statistics() To get the forum statistics 
  21. * @uses current_user_can() To check if the user is capable of doing things 
  22. * @uses bbp_get_forum_post_type() To get the forum post type 
  23. * @uses bbp_get_topic_post_type() To get the topic post type 
  24. * @uses bbp_get_reply_post_type() To get the reply post type 
  25. * @uses get_admin_url() To get the administration url 
  26. * @uses add_query_arg() To add custom args to the url 
  27. * @uses do_action() Calls 'bbp_dashboard_widget_right_now_content_table_end' 
  28. * below the content table 
  29. * @uses do_action() Calls 'bbp_dashboard_widget_right_now_table_end' 
  30. * below the discussion table 
  31. * @uses do_action() Calls 'bbp_dashboard_widget_right_now_discussion_table_end' 
  32. * below the discussion table 
  33. * @uses do_action() Calls 'bbp_dashboard_widget_right_now_end' below the widget 
  34. */ 
  35. function bbp_dashboard_widget_right_now() { 
  36.  
  37. // Get the statistics 
  38. $r = bbp_get_statistics(); ?> 
  39.  
  40. <div class="table table_content"> 
  41.  
  42. <p class="sub"><?php esc_html_e( 'Discussion', 'bbpress' ); ?></p> 
  43.  
  44. <table> 
  45.  
  46. <tr class="first"> 
  47.  
  48. <?php 
  49. $num = $r['forum_count']; 
  50. $text = _n( 'Forum', 'Forums', $r['forum_count'], 'bbpress' ); 
  51. if ( current_user_can( 'publish_forums' ) ) { 
  52. $link = add_query_arg( array( 'post_type' => bbp_get_forum_post_type() ), get_admin_url( null, 'edit.php' ) ); 
  53. $num = '<a href="' . esc_url( $link ) . '">' . $num . '</a>'; 
  54. $text = '<a href="' . esc_url( $link ) . '">' . $text . '</a>'; 
  55. ?> 
  56.  
  57. <td class="first b b-forums"><?php echo $num; ?></td> 
  58. <td class="t forums"><?php echo $text; ?></td> 
  59.  
  60. </tr> 
  61.  
  62. <tr> 
  63.  
  64. <?php 
  65. $num = $r['topic_count']; 
  66. $text = _n( 'Topic', 'Topics', $r['topic_count'], 'bbpress' ); 
  67. if ( current_user_can( 'publish_topics' ) ) { 
  68. $link = add_query_arg( array( 'post_type' => bbp_get_topic_post_type() ), get_admin_url( null, 'edit.php' ) ); 
  69. $num = '<a href="' . esc_url( $link ) . '">' . $num . '</a>'; 
  70. $text = '<a href="' . esc_url( $link ) . '">' . $text . '</a>'; 
  71. ?> 
  72.  
  73. <td class="first b b-topics"><?php echo $num; ?></td> 
  74. <td class="t topics"><?php echo $text; ?></td> 
  75.  
  76. </tr> 
  77.  
  78. <tr> 
  79.  
  80. <?php 
  81. $num = $r['reply_count']; 
  82. $text = _n( 'Reply', 'Replies', $r['reply_count'], 'bbpress' ); 
  83. if ( current_user_can( 'publish_replies' ) ) { 
  84. $link = add_query_arg( array( 'post_type' => bbp_get_reply_post_type() ), get_admin_url( null, 'edit.php' ) ); 
  85. $num = '<a href="' . esc_url( $link ) . '">' . $num . '</a>'; 
  86. $text = '<a href="' . esc_url( $link ) . '">' . $text . '</a>'; 
  87. ?> 
  88.  
  89. <td class="first b b-replies"><?php echo $num; ?></td> 
  90. <td class="t replies"><?php echo $text; ?></td> 
  91.  
  92. </tr> 
  93.  
  94. <?php if ( bbp_allow_topic_tags() ) : ?> 
  95.  
  96. <tr> 
  97.  
  98. <?php 
  99. $num = $r['topic_tag_count']; 
  100. $text = _n( 'Topic Tag', 'Topic Tags', $r['topic_tag_count'], 'bbpress' ); 
  101. if ( current_user_can( 'manage_topic_tags' ) ) { 
  102. $link = add_query_arg( array( 'taxonomy' => bbp_get_topic_tag_tax_id(), 'post_type' => bbp_get_topic_post_type() ), get_admin_url( null, 'edit-tags.php' ) ); 
  103. $num = '<a href="' . esc_url( $link ) . '">' . $num . '</a>'; 
  104. $text = '<a href="' . esc_url( $link ) . '">' . $text . '</a>'; 
  105. ?> 
  106.  
  107. <td class="first b b-topic_tags"><span class="total-count"><?php echo $num; ?></span></td> 
  108. <td class="t topic_tags"><?php echo $text; ?></td> 
  109.  
  110. </tr> 
  111.  
  112. <?php endif; ?> 
  113.  
  114. <?php do_action( 'bbp_dashboard_widget_right_now_content_table_end' ); ?> 
  115.  
  116. </table> 
  117.  
  118. </div> 
  119.  
  120.  
  121. <div class="table table_discussion"> 
  122.  
  123. <p class="sub"><?php esc_html_e( 'Users & Moderation', 'bbpress' ); ?></p> 
  124.  
  125. <table> 
  126.  
  127. <tr class="first"> 
  128.  
  129. <?php 
  130. $num = $r['user_count']; 
  131. $text = _n( 'User', 'Users', $r['user_count'], 'bbpress' ); 
  132. if ( current_user_can( 'edit_users' ) ) { 
  133. $link = get_admin_url( null, 'users.php' ); 
  134. $num = '<a href="' . esc_url( $link ) . '">' . $num . '</a>'; 
  135. $text = '<a href="' . esc_url( $link ) . '">' . $text . '</a>'; 
  136. ?> 
  137.  
  138. <td class="b b-users"><span class="total-count"><?php echo $num; ?></span></td> 
  139. <td class="last t users"><?php echo $text; ?></td> 
  140.  
  141. </tr> 
  142.  
  143. <?php if ( isset( $r['topic_count_hidden'] ) ) : ?> 
  144.  
  145. <tr> 
  146.  
  147. <?php 
  148. $num = $r['topic_count_hidden']; 
  149. $text = _n( 'Hidden Topic', 'Hidden Topics', $r['topic_count_hidden'], 'bbpress' ); 
  150. $link = add_query_arg( array( 'post_type' => bbp_get_topic_post_type() ), get_admin_url( null, 'edit.php' ) ); 
  151. if ( '0' !== $num ) { 
  152. $link = add_query_arg( array( 'post_status' => bbp_get_spam_status_id() ), $link ); 
  153. $num = '<a href="' . esc_url( $link ) . '" title="' . esc_attr( $r['hidden_topic_title'] ) . '">' . $num . '</a>'; 
  154. $text = '<a class="waiting" href="' . esc_url( $link ) . '" title="' . esc_attr( $r['hidden_topic_title'] ) . '">' . $text . '</a>'; 
  155. ?> 
  156.  
  157. <td class="b b-hidden-topics"><?php echo $num; ?></td> 
  158. <td class="last t hidden-replies"><?php echo $text; ?></td> 
  159.  
  160. </tr> 
  161.  
  162. <?php endif; ?> 
  163.  
  164. <?php if ( isset( $r['reply_count_hidden'] ) ) : ?> 
  165.  
  166. <tr> 
  167.  
  168. <?php 
  169. $num = $r['reply_count_hidden']; 
  170. $text = _n( 'Hidden Reply', 'Hidden Replies', $r['reply_count_hidden'], 'bbpress' ); 
  171. $link = add_query_arg( array( 'post_type' => bbp_get_reply_post_type() ), get_admin_url( null, 'edit.php' ) ); 
  172. if ( '0' !== $num ) { 
  173. $link = add_query_arg( array( 'post_status' => bbp_get_spam_status_id() ), $link ); 
  174. $num = '<a href="' . esc_url( $link ) . '" title="' . esc_attr( $r['hidden_reply_title'] ) . '">' . $num . '</a>'; 
  175. $text = '<a class="waiting" href="' . esc_url( $link ) . '" title="' . esc_attr( $r['hidden_reply_title'] ) . '">' . $text . '</a>'; 
  176. ?> 
  177.  
  178. <td class="b b-hidden-replies"><?php echo $num; ?></td> 
  179. <td class="last t hidden-replies"><?php echo $text; ?></td> 
  180.  
  181. </tr> 
  182.  
  183. <?php endif; ?> 
  184.  
  185. <?php if ( bbp_allow_topic_tags() && isset( $r['empty_topic_tag_count'] ) ) : ?> 
  186.  
  187. <tr> 
  188.  
  189. <?php 
  190. $num = $r['empty_topic_tag_count']; 
  191. $text = _n( 'Empty Topic Tag', 'Empty Topic Tags', $r['empty_topic_tag_count'], 'bbpress' ); 
  192. $link = add_query_arg( array( 'taxonomy' => bbp_get_topic_tag_tax_id(), 'post_type' => bbp_get_topic_post_type() ), get_admin_url( null, 'edit-tags.php' ) ); 
  193. $num = '<a href="' . esc_url( $link ) . '">' . $num . '</a>'; 
  194. $text = '<a class="waiting" href="' . esc_url( $link ) . '">' . $text . '</a>'; 
  195. ?> 
  196.  
  197. <td class="b b-hidden-topic-tags"><?php echo $num; ?></td> 
  198. <td class="last t hidden-topic-tags"><?php echo $text; ?></td> 
  199.  
  200. </tr> 
  201.  
  202. <?php endif; ?> 
  203.  
  204. <?php do_action( 'bbp_dashboard_widget_right_now_discussion_table_end' ); ?> 
  205.  
  206. </table> 
  207.  
  208. </div> 
  209.  
  210. <?php do_action( 'bbp_dashboard_widget_right_now_table_end' ); ?> 
  211.  
  212. <div class="versions"> 
  213.  
  214. <span id="wp-version-message"> 
  215. <?php printf( __( 'You are using <span class="b">bbPress %s</span>.', 'bbpress' ), bbp_get_version() ); ?> 
  216. </span> 
  217.  
  218. </div> 
  219.  
  220. <br class="clear" /> 
  221.  
  222. <?php 
  223.  
  224. do_action( 'bbp_dashboard_widget_right_now_end' ); 
  225.  
  226. /** Forums ********************************************************************/ 
  227.  
  228. /** 
  229. * Forum metabox 
  230. * 
  231. * The metabox that holds all of the additional forum information 
  232. * 
  233. * @since bbPress (r2744) 
  234. * 
  235. * @uses bbp_is_forum_closed() To check if a forum is closed or not 
  236. * @uses bbp_is_forum_category() To check if a forum is a category or not 
  237. * @uses bbp_is_forum_private() To check if a forum is private or not 
  238. * @uses bbp_dropdown() To show a dropdown of the forums for forum parent 
  239. * @uses do_action() Calls 'bbp_forum_metabox' 
  240. */ 
  241. function bbp_forum_metabox() { 
  242.  
  243. // Post ID 
  244. $post_id = get_the_ID(); 
  245. $post_parent = bbp_get_global_post_field( 'post_parent', 'raw' ); 
  246. $menu_order = bbp_get_global_post_field( 'menu_order', 'edit' ); 
  247.  
  248. /** Type ******************************************************************/ 
  249.  
  250. ?> 
  251.  
  252. <p> 
  253. <strong class="label"><?php esc_html_e( 'Type:', 'bbpress' ); ?></strong> 
  254. <label class="screen-reader-text" for="bbp_forum_type_select"><?php esc_html_e( 'Type:', 'bbpress' ) ?></label> 
  255. <?php bbp_form_forum_type_dropdown( array( 'forum_id' => $post_id ) ); ?> 
  256. </p> 
  257.  
  258. <?php 
  259.  
  260. /** Status ****************************************************************/ 
  261.  
  262. ?> 
  263.  
  264. <p> 
  265. <strong class="label"><?php esc_html_e( 'Status:', 'bbpress' ); ?></strong> 
  266. <label class="screen-reader-text" for="bbp_forum_status_select"><?php esc_html_e( 'Status:', 'bbpress' ) ?></label> 
  267. <?php bbp_form_forum_status_dropdown( array( 'forum_id' => $post_id ) ); ?> 
  268. </p> 
  269.  
  270. <?php 
  271.  
  272. /** Visibility ************************************************************/ 
  273.  
  274. ?> 
  275.  
  276. <p> 
  277. <strong class="label"><?php esc_html_e( 'Visibility:', 'bbpress' ); ?></strong> 
  278. <label class="screen-reader-text" for="bbp_forum_visibility_select"><?php esc_html_e( 'Visibility:', 'bbpress' ) ?></label> 
  279. <?php bbp_form_forum_visibility_dropdown( array( 'forum_id' => $post_id ) ); ?> 
  280. </p> 
  281.  
  282. <hr /> 
  283.  
  284. <?php 
  285.  
  286. /** Parent ****************************************************************/ 
  287.  
  288. ?> 
  289.  
  290. <p> 
  291. <strong class="label"><?php esc_html_e( 'Parent:', 'bbpress' ); ?></strong> 
  292. <label class="screen-reader-text" for="parent_id"><?php esc_html_e( 'Forum Parent', 'bbpress' ); ?></label> 
  293. <?php bbp_dropdown( array( 
  294. 'post_type' => bbp_get_forum_post_type(),  
  295. 'selected' => $post_parent,  
  296. 'numberposts' => -1,  
  297. 'orderby' => 'title',  
  298. 'order' => 'ASC',  
  299. 'walker' => '',  
  300. 'exclude' => $post_id,  
  301.  
  302. // Output-related 
  303. 'select_id' => 'parent_id',  
  304. 'tab' => bbp_get_tab_index(),  
  305. 'options_only' => false,  
  306. 'show_none' => __( '— No parent —', 'bbpress' ),  
  307. 'disable_categories' => false,  
  308. 'disabled' => '' 
  309. ) ); ?> 
  310. </p> 
  311.  
  312. <p> 
  313. <strong class="label"><?php esc_html_e( 'Order:', 'bbpress' ); ?></strong> 
  314. <label class="screen-reader-text" for="menu_order"><?php esc_html_e( 'Forum Order', 'bbpress' ); ?></label> 
  315. <input name="menu_order" type="number" step="1" size="4" id="menu_order" value="<?php echo esc_attr( $menu_order ); ?>" /> 
  316. </p> 
  317.  
  318. <input name="ping_status" type="hidden" id="ping_status" value="open" /> 
  319.  
  320. <?php 
  321. wp_nonce_field( 'bbp_forum_metabox_save', 'bbp_forum_metabox' ); 
  322. do_action( 'bbp_forum_metabox', $post_id ); 
  323.  
  324. /** Topics ********************************************************************/ 
  325.  
  326. /** 
  327. * Topic metabox 
  328. * 
  329. * The metabox that holds all of the additional topic information 
  330. * 
  331. * @since bbPress (r2464) 
  332. * 
  333. * @uses bbp_get_topic_forum_id() To get the topic forum id 
  334. * @uses do_action() Calls 'bbp_topic_metabox' 
  335. */ 
  336. function bbp_topic_metabox() { 
  337.  
  338. // Post ID 
  339. $post_id = get_the_ID(); 
  340.  
  341. /** Type ******************************************************************/ 
  342.  
  343. ?> 
  344.  
  345. <p> 
  346. <strong class="label"><?php esc_html_e( 'Type:', 'bbpress' ); ?></strong> 
  347. <label class="screen-reader-text" for="bbp_stick_topic"><?php esc_html_e( 'Topic Type', 'bbpress' ); ?></label> 
  348. <?php bbp_form_topic_type_dropdown( array( 'topic_id' => $post_id ) ); ?> 
  349. </p> 
  350.  
  351. <?php 
  352.  
  353. /** Status ****************************************************************/ 
  354.  
  355. ?> 
  356.  
  357. <p> 
  358. <strong class="label"><?php esc_html_e( 'Status:', 'bbpress' ); ?></strong> 
  359. <label class="screen-reader-text" for="bbp_open_close_topic"><?php esc_html_e( 'Select whether to open or close the topic.', 'bbpress' ); ?></label> 
  360. <?php bbp_form_topic_status_dropdown( array( 'select_id' => 'post_status', 'topic_id' => $post_id ) ); ?> 
  361. </p> 
  362.  
  363. <?php 
  364.  
  365. /** Parent *****************************************************************/ 
  366.  
  367. ?> 
  368.  
  369. <p> 
  370. <strong class="label"><?php esc_html_e( 'Forum:', 'bbpress' ); ?></strong> 
  371. <label class="screen-reader-text" for="parent_id"><?php esc_html_e( 'Forum', 'bbpress' ); ?></label> 
  372. <?php bbp_dropdown( array( 
  373. 'post_type' => bbp_get_forum_post_type(),  
  374. 'selected' => bbp_get_topic_forum_id( $post_id ),  
  375. 'numberposts' => -1,  
  376. 'orderby' => 'title',  
  377. 'order' => 'ASC',  
  378. 'walker' => '',  
  379. 'exclude' => '',  
  380.  
  381. // Output-related 
  382. 'select_id' => 'parent_id',  
  383. 'tab' => bbp_get_tab_index(),  
  384. 'options_only' => false,  
  385. 'show_none' => __( '— No parent —', 'bbpress' ),  
  386. 'disable_categories' => current_user_can( 'edit_forums' ),  
  387. 'disabled' => '' 
  388. ) ); ?> 
  389. </p> 
  390.  
  391. <input name="ping_status" type="hidden" id="ping_status" value="open" /> 
  392.  
  393. <?php 
  394. wp_nonce_field( 'bbp_topic_metabox_save', 'bbp_topic_metabox' ); 
  395. do_action( 'bbp_topic_metabox', $post_id ); 
  396.  
  397. /** Replies *******************************************************************/ 
  398.  
  399. /** 
  400. * Reply metabox 
  401. * 
  402. * The metabox that holds all of the additional reply information 
  403. * 
  404. * @since bbPress (r2464) 
  405. * 
  406. * @uses bbp_get_topic_post_type() To get the topic post type 
  407. * @uses do_action() Calls 'bbp_reply_metabox' 
  408. */ 
  409. function bbp_reply_metabox() { 
  410.  
  411. // Post ID 
  412. $post_id = get_the_ID(); 
  413.  
  414. // Get some meta 
  415. $reply_topic_id = bbp_get_reply_topic_id( $post_id ); 
  416. $reply_forum_id = bbp_get_reply_forum_id( $post_id ); 
  417. $reply_to = bbp_get_reply_to( $post_id ); 
  418.  
  419. // Allow individual manipulation of reply forum 
  420. if ( current_user_can( 'edit_others_replies' ) || current_user_can( 'moderate' ) ) : ?> 
  421.  
  422. <p> 
  423. <strong class="label"><?php esc_html_e( 'Forum:', 'bbpress' ); ?></strong> 
  424. <label class="screen-reader-text" for="bbp_forum_id"><?php esc_html_e( 'Forum', 'bbpress' ); ?></label> 
  425. <?php bbp_dropdown( array( 
  426. 'post_type' => bbp_get_forum_post_type(),  
  427. 'selected' => $reply_forum_id,  
  428. 'numberposts' => -1,  
  429. 'orderby' => 'title',  
  430. 'order' => 'ASC',  
  431. 'walker' => '',  
  432. 'exclude' => '',  
  433.  
  434. // Output-related 
  435. 'select_id' => 'bbp_forum_id',  
  436. 'tab' => bbp_get_tab_index(),  
  437. 'options_only' => false,  
  438. 'show_none' => __( '— No parent —', 'bbpress' ),  
  439. 'disable_categories' => current_user_can( 'edit_forums' ),  
  440. 'disabled' => '' 
  441. ) ); ?> 
  442. </p> 
  443.  
  444. <?php endif; ?> 
  445.  
  446. <p> 
  447. <strong class="label"><?php esc_html_e( 'Topic:', 'bbpress' ); ?></strong> 
  448. <label class="screen-reader-text" for="parent_id"><?php esc_html_e( 'Topic', 'bbpress' ); ?></label> 
  449. <input name="parent_id" id="bbp_topic_id" type="text" value="<?php echo esc_attr( $reply_topic_id ); ?>" data-ajax-url="<?php echo esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'bbp_suggest_topic' ), admin_url( 'admin-ajax.php', 'relative' ) ) ), 'bbp_suggest_topic_nonce' ); ?>" /> 
  450. </p> 
  451.  
  452. <p> 
  453. <strong class="label"><?php esc_html_e( 'Reply To:', 'bbpress' ); ?></strong> 
  454. <label class="screen-reader-text" for="bbp_reply_to"><?php esc_html_e( 'Reply To', 'bbpress' ); ?></label> 
  455. <input name="bbp_reply_to" id="bbp_reply_to" type="text" value="<?php echo esc_attr( $reply_to ); ?>" /> 
  456. </p> 
  457.  
  458. <input name="ping_status" type="hidden" id="ping_status" value="open" /> 
  459.  
  460. <?php 
  461. wp_nonce_field( 'bbp_reply_metabox_save', 'bbp_reply_metabox' ); 
  462. do_action( 'bbp_reply_metabox', $post_id ); 
  463.  
  464. /** Users *********************************************************************/ 
  465.  
  466. /** 
  467. * Anonymous user information metabox 
  468. * 
  469. * @since bbPress (r2828) 
  470. * 
  471. * @uses bbp_is_reply_anonymous() To check if reply is anonymous 
  472. * @uses bbp_is_topic_anonymous() To check if topic is anonymous 
  473. * @uses get_the_ID() To get the global post ID 
  474. * @uses get_post_meta() To get the author user information 
  475. */ 
  476. function bbp_author_metabox() { 
  477.  
  478. // Post ID 
  479. $post_id = get_the_ID(); 
  480.  
  481. // Show extra bits if topic/reply is anonymous 
  482. if ( bbp_is_reply_anonymous( $post_id ) || bbp_is_topic_anonymous( $post_id ) ) : ?> 
  483.  
  484. <p> 
  485. <strong class="label"><?php esc_html_e( 'Name:', 'bbpress' ); ?></strong> 
  486. <label class="screen-reader-text" for="bbp_anonymous_name"><?php esc_html_e( 'Name', 'bbpress' ); ?></label> 
  487. <input type="text" id="bbp_anonymous_name" name="bbp_anonymous_name" value="<?php echo esc_attr( get_post_meta( $post_id, '_bbp_anonymous_name', true ) ); ?>" /> 
  488. </p> 
  489.  
  490. <p> 
  491. <strong class="label"><?php esc_html_e( 'Email:', 'bbpress' ); ?></strong> 
  492. <label class="screen-reader-text" for="bbp_anonymous_email"><?php esc_html_e( 'Email', 'bbpress' ); ?></label> 
  493. <input type="text" id="bbp_anonymous_email" name="bbp_anonymous_email" value="<?php echo esc_attr( get_post_meta( $post_id, '_bbp_anonymous_email', true ) ); ?>" /> 
  494. </p> 
  495.  
  496. <p> 
  497. <strong class="label"><?php esc_html_e( 'Website:', 'bbpress' ); ?></strong> 
  498. <label class="screen-reader-text" for="bbp_anonymous_website"><?php esc_html_e( 'Website', 'bbpress' ); ?></label> 
  499. <input type="text" id="bbp_anonymous_website" name="bbp_anonymous_website" value="<?php echo esc_attr( get_post_meta( $post_id, '_bbp_anonymous_website', true ) ); ?>" /> 
  500. </p> 
  501.  
  502. <?php else : ?> 
  503.  
  504. <p> 
  505. <strong class="label"><?php esc_html_e( 'ID:', 'bbpress' ); ?></strong> 
  506. <label class="screen-reader-text" for="bbp_author_id"><?php esc_html_e( 'ID', 'bbpress' ); ?></label> 
  507. <input type="text" id="bbp_author_id" name="post_author_override" value="<?php echo esc_attr( bbp_get_global_post_field( 'post_author' ) ); ?>" data-ajax-url="<?php echo esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'bbp_suggest_user' ), admin_url( 'admin-ajax.php', 'relative' ) ) ), 'bbp_suggest_user_nonce' ); ?>" /> 
  508. </p> 
  509.  
  510. <?php endif; ?> 
  511.  
  512. <p> 
  513. <strong class="label"><?php esc_html_e( 'IP:', 'bbpress' ); ?></strong> 
  514. <label class="screen-reader-text" for="bbp_author_ip_address"><?php esc_html_e( 'IP Address', 'bbpress' ); ?></label> 
  515. <input type="text" id="bbp_author_ip_address" name="bbp_author_ip_address" value="<?php echo esc_attr( get_post_meta( $post_id, '_bbp_author_ip', true ) ); ?>" disabled="disabled" /> 
  516. </p> 
  517.  
  518. <?php 
  519.  
  520. do_action( 'bbp_author_metabox', $post_id ); 
.