Ticket #2275: metaboxes.php.patch
File metaboxes.php.patch, 2.4 KB (added by , 12 years ago) |
---|
-
includes/admin/metaboxes.php
344 344 function bbp_topic_metabox() { 345 345 346 346 // Post ID 347 $post_id = get_the_ID(); ?> 347 $post_id = get_the_ID(); 348 $parent_id = bbp_get_topic_forum_id( $post_id ); 349 $parent_view_link = get_permalink( $parent_id ); 350 $parent_edit_link = admin_url( sprintf( 'post.php?post=%d&action=edit', $parent_id ) ); 348 351 352 ?> 353 349 354 <p> 350 355 <strong class="label"><?php _e( 'Type:', 'bbpress' ); ?></strong> 351 356 <label class="screen-reader-text" for="bbp_stick_topic"><?php _e( 'Topic Type', 'bbpress' ); ?></label> … … 357 362 <label class="screen-reader-text" for="parent_id"><?php _e( 'Forum', 'bbpress' ); ?></label> 358 363 <?php bbp_dropdown( array( 359 364 'post_type' => bbp_get_forum_post_type(), 360 'selected' => bbp_get_topic_forum_id( $post_id ),365 'selected' => $parent_id, 361 366 'numberposts' => -1, 362 367 'orderby' => 'title', 363 368 'order' => 'ASC', … … 373 378 'disable_categories' => current_user_can( 'edit_forums' ), 374 379 'disabled' => '' 375 380 ) ); ?> 381 <?php if ( ! empty( $parent_view_link ) ): ?> 382 <br/> 383 <a href="<?php echo esc_attr( $parent_view_link );?>"><?php _e( 'View', 'bbpress' );?></a> 384 - 385 <a href="<?php echo esc_attr( $parent_edit_link );?>"><?php _e( 'Edit', 'bbpress' );?></a> 386 387 <?php endif; ?> 376 388 </p> 377 389 390 378 391 <?php 379 392 wp_nonce_field( 'bbp_topic_metabox_save', 'bbp_topic_metabox' ); 380 393 do_action( 'bbp_topic_metabox', $post_id ); … … 429 442 430 443 <?php endif; ?> 431 444 445 <?php 446 $parent_view_link = get_permalink( $reply_topic_id ); 447 $parent_edit_link = admin_url( sprintf( 'post.php?post=%d&action=edit', $reply_topic_id ) ); 448 ?> 432 449 <p> 433 450 <strong class="label"><?php _e( 'Topic:', 'bbpress' ); ?></strong> 434 451 <label class="screen-reader-text" for="parent_id"><?php _e( 'Topic', 'bbpress' ); ?></label> 435 452 <input name="parent_id" id="bbp_topic_id" type="text" value="<?php echo esc_attr( $reply_topic_id ); ?>" /> 453 454 <?php if ( ! empty( $parent_view_link ) ): ?> 455 <br/> 456 <a href="<?php echo esc_attr( $parent_view_link );?>"><?php _e( 'View', 'bbpress' );?></a> 457 - 458 <a href="<?php echo esc_attr( $parent_edit_link );?>"><?php _e( 'Edit', 'bbpress' );?></a> 459 460 <?php endif; ?> 461 436 462 </p> 437 463 438 464 <?php