Skip to content

Commit

Permalink
Remove invalid 'stick to front' link after bbPress mangles it.
Browse files Browse the repository at this point in the history
Instead of removing just the link text, we want to remove the link
altogether. This prevents 'empty link' errors in WAVE tests.

See #3269.
  • Loading branch information
boonebgorges committed Nov 2, 2023
1 parent 63b9dab commit b360248
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions wp-content/themes/openlab/lib/plugin-hooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,22 @@ function( $args ) {
}
);

/**
* Fix bbPress's bad 'hide_super_sticky_admin_link' regex.
*
* It only removes the text, but we want to remove the entire empty element.
*
* This ensures that we don't get "empty link" errors in WAVE tests.
*/
add_filter(
'bbp_get_topic_stick_link',
function( $link ) {
// Remove anchor elements with the class bbp-topic-super-sticky-link.
return preg_replace( '/<a[^>]*class="bbp-topic-super-sticky-link"[^>]*><\/a>/', '', $link );
},
100
);

/**
* Handle feature toggling for groups.
*/
Expand Down

0 comments on commit b360248

Please sign in to comment.