Created
December 6, 2016 17:59
-
-
Save imath/ea4f65b25746ffd45319d5a990caeaf0 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