Changeset 4892 for sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-support/functions.php
- Timestamp:
- 02/08/2017 07:08:35 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-support/functions.php
r4890 r4892 296 296 add_filter( 'bbp_topic_admin_links', 'wporg_support_change_super_sticky_text' ); 297 297 298 /** 299 * Correct reply URLs for pending posts. 300 * 301 * bbPress appends '/edit/' even to ugly permalinks, which pending posts will 302 * always have. 303 * 304 * @see https://meta.trac.wordpress.org/ticket/2478 305 * @see https://bbpress.trac.wordpress.org/ticket/3054 306 * 307 * @param string $url URL to edit the post. 308 * @param int $post_id Post ID. 309 * @return string 310 */ 311 function wporg_support_fix_pending_posts_reply_url( $url, $post_id ) { 312 if ( false !== strpos( $url, '?' ) && false !== strpos( $url, '/edit/' ) ) { 313 $url = str_replace( '/edit/', '', $url ); 314 $url = add_query_arg( 'edit', '1', $url ); 315 } 316 317 return $url; 318 } 319 add_filter( 'bbp_get_topic_edit_url', 'wporg_support_fix_pending_posts_reply_url', 10, 2 ); 320 add_filter( 'bbp_get_reply_edit_url', 'wporg_support_fix_pending_posts_reply_url', 10, 2 ); 321 322 298 323 /** bb Base *******************************************************************/ 299 324
Note: See TracChangeset
for help on using the changeset viewer.