diff --git a/syntaxhighlighter.php b/syntaxhighlighter.php index 07e3e67..a0a687d 100644 --- a/syntaxhighlighter.php +++ b/syntaxhighlighter.php @@ -46,6 +46,8 @@ function __construct() { add_filter( 'the_content', array( $this, 'parse_shortcodes' ), 7 ); // Posts add_filter( 'comment_text', array( $this, 'parse_shortcodes_comment' ), 7 ); // Comments add_filter( 'bp_get_the_topic_post_content', array( $this, 'parse_shortcodes' ), 7 ); // BuddyPress + add_filter( 'bbp_get_topic_content', array( $this, 'parse_shortcodes' ), 7 ); // bbPress + add_filter( 'bbp_get_reply_content', array( $this, 'parse_shortcodes' ), 7 ); // bbPress // Exempt shortcodes from wptexturize() add_filter( 'no_texturize_shortcodes', array( $this, 'no_texturize_shortcodes' ) ); @@ -55,12 +57,18 @@ function __construct() { add_filter( 'pre_comment_content', array( $this, 'encode_shortcode_contents_slashed' ), 1 ); // Comments add_filter( 'group_forum_post_text_before_save', array( $this, 'encode_shortcode_contents_slashed' ), 1 ); // BuddyPress add_filter( 'group_forum_topic_text_before_save', array( $this, 'encode_shortcode_contents_slashed' ), 1 ); // BuddyPress + add_filter( 'bbp_new_topic_pre_content', array( $this, 'encode_shortcode_contents_slashed' ), 1 ); // bbPress + add_filter( 'bbp_new_reply_pre_content', array( $this, 'encode_shortcode_contents_slashed' ), 1 ); // bbPress + add_filter( 'bbp_edit_topic_pre_content', array( $this, 'encode_shortcode_contents_slashed' ), 1 ); // bbPress + add_filter( 'bbp_edit_reply_pre_content', array( $this, 'encode_shortcode_contents_slashed' ), 1 ); // bbPress // Out of the database for editing add_filter( 'the_editor_content', array( $this, 'the_editor_content' ), 1 ); // Posts add_filter( 'comment_edit_pre', array( $this, 'decode_shortcode_contents' ), 1 ); // Comments add_filter( 'bp_get_the_topic_text', array( $this, 'decode_shortcode_contents' ), 1 ); // BuddyPress add_filter( 'bp_get_the_topic_post_edit_text', array( $this, 'decode_shortcode_contents' ), 1 ); // BuddyPress + add_filter( 'bbp_get_topic_content', array( $this, 'decode_shortcode_contents' ), 1 ); // bbPress + add_filter( 'bbp_get_reply_content', array( $this, 'decode_shortcode_contents' ), 1 ); // bbPress // Outputting SyntaxHighlighter's JS and CSS add_action( 'wp_head', array( $this, 'output_header_placeholder' ), 15 ); @@ -68,6 +76,10 @@ function __construct() { add_action( 'wp_footer', array( $this, 'maybe_output_scripts' ), 15 ); add_action( 'admin_footer', array( $this, 'maybe_output_scripts' ), 15 ); // For comments + // Front end output of scortcodes script if "fancy editor" is enabled by bbPress + if ( function_exists( 'bbp_use_wp_editor' ) && bbp_use_wp_editor() ) + add_action( 'bbp_head', array( $this, 'output_shortcodes_for_tinymce' ) ); + // Admin hooks add_action( 'admin_init', array( $this, 'register_setting' ) ); add_action( 'admin_menu', array( $this, 'register_settings_page' ) ); @@ -418,6 +430,18 @@ function encode_shortcode_contents_slashed_noquickedit( $content ) { if ( ! empty( $_POST ) && !empty( $_POST['action'] ) && 'inline-save' == $_POST['action'] ) return $content; + // bbPress (front-end) admin links for topic split or merge and reply move + if ( !empty( $_POST ) && !empty( $_POST['action'] ) && ( 'bbp-move-reply' == $_POST['action'] || 'bbp-split-topic' == $_POST['action'] || 'bbp-merge-topic' == $_POST['action'] ) ) + return $content; + + // bbPress (front-end) admin links for trash + if ( !empty( $_GET ) && !empty( $_GET['action'] ) && ( 'bbp_toggle_topic_trash' == $_GET['action'] || 'bbp_toggle_reply_trash' == $_GET['action'] ) ) + return $content; + + // bbPress admin links (front-end) and quick links (wp-admin) for spam + if ( !empty( $_GET ) && !empty( $_GET['action'] ) && ( 'bbp_toggle_topic_spam' == $_GET['action'] || 'bbp_toggle_reply_spam' == $_GET['action'] ) ) + return $content; + return $this->encode_shortcode_contents_slashed( $content ); }