-
-
Save toluaddy/8946e3452ca139422c4bddbcc89e42f2 to your computer and use it in GitHub Desktop.
Add a confirmation prompt to remove link in BuddyPress groups.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Exit if accessed directly | |
defined( 'ABSPATH' ) || exit; | |
function georgio_idea_footer_actions( $footer = '' ) { | |
if ( ! bp_is_group() ) { | |
return $footer; | |
} | |
preg_match( '/class=\"remove-(.*)\"/', $footer, $classes ); | |
if ( ! empty( $classes[1] ) && 0 === strpos( $classes[1], 'idea' ) ) { | |
$new_classes = str_replace( 'idea', 'idea confirm', $classes[0] ); | |
$footer = str_replace( $classes[0], $new_classes, $footer ); | |
} | |
return $footer; | |
} | |
add_filter( 'wp_idea_stream_ideas_get_idea_footer', 'georgio_idea_footer_actions', 12, 1 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment