jawittdesigns (@jawittdesigns)

Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)

  • jawittdesigns
    Participant

    @jawittdesigns

    I still haven’t been able to find where the & character conversion is taking place, but I have managed to get it to work.

    Here’s the class I’m using

    class JPM_BBP_Support {
    
        /**
         * Initialize the class and set its properties.
         */
        public function __construct() {
            add_action( 'plugins_loaded', array( $this, 'custom_jetpack_markdown_support' ) );
            // Remove the back_code_trick filter
            remove_filter( 'bbp_new_reply_pre_content',  'bbp_code_trick',  20 );
            remove_filter( 'bbp_new_topic_pre_content',  'bbp_code_trick',  20 );
            remove_filter( 'bbp_new_forum_pre_content',  'bbp_code_trick',  20 );
            remove_filter( 'bbp_edit_reply_pre_content', 'bbp_code_trick',  20 );
            remove_filter( 'bbp_edit_topic_pre_content', 'bbp_code_trick',  20 );
            remove_filter( 'bbp_edit_forum_pre_content', 'bbp_code_trick',  20 );
    
            add_filter( 'bbp_get_reply_content', array( $this, 'custom_con_char' ), 6 );
            add_filter( 'bbp_get_topic_content',  array( $this, 'custom_con_char' ), 6 );
        }
    
        /**
         * Replace instances of < and >
         * with < and > when pulling the content
         * from the databse to display
         * 
         * @param  string $content the content stored in the database
         * @return string          the formated content
         */
        public function custom_con_char( $content = '' ) {
            $content = str_replace( '<', '<' , $content );
            $content = str_replace( '>', '>' , $content );
            return $content;
        }
    
        /**
         * Add Markdown support for BBPress Froums
         */
        public function custom_jetpack_markdown_support() {
            add_post_type_support( 'topic', 'wpcom-markdown' );
            add_post_type_support( 'reply', 'wpcom-markdown' );
        }
    }
    
    $jmp_bbp_support = new JPM_BBP_Support();

    jawittdesigns
    Participant

    @jawittdesigns

    No, that adds custom post type support by looping through the custom post types using the add_post_type_support() function. I already have that set.

Viewing 2 replies - 1 through 2 (of 2 total)