Skip to:
Content
Pages
Categories
Search
Top
Bottom

[Resolved] Get raw post output on group settings admin screen

  • @dcavins

    Keymaster

    I’d like to output raw post data (for use in an instance of wp_editor) on a group admin screen, but even if it’s fetched with get_the_content() what is output on the screen has had prettification filters applied to it. I suspect the problem is with the way theme compat uses output buffering on these screens.

    Can anyone suggest a way to keep raw post data raw on a group admin screen, i.e. no short code interpretation, no printer’s quotes, etc?

    Thanks in advance for your help.

Viewing 3 replies - 1 through 3 (of 3 total)
  • @dcavins

    Keymaster

    I still haven’t solved this. It looks like it’s not just me though. It’s also true that if you insert short codes in bbPress topic content then edit that content, the short codes are interpreted in the editor input box.

    Does anyone have any ideas how I could make some headway on this problem? Thanks!

    @danbp

    Participant

    @dcavins,

    Do you mean the group admin screen on back end ?
    Have you tried to strip the shortcode ?
    $content = strip_shortcodes($content);
    return $content;

    Removing some filters may also work ?
    http://wp-a2z.com/oik_api/kses_remove_filters/
    Or, sorry if i’m wrong, see here a similar question, with a clever answer which maybe help you further.

    @dcavins

    Keymaster

    I think I’ve solved this by removing the do_shortcode filter on that admin page. (It’s the front-end settings screen created by the group extension.)

    
    add_action('bp_init','dont_process_shortcodes_filter');
    function dont_process_shortcodes_filter() {
          if ( bp_is_current_component( 'groups' ) && bp_is_current_action( 'admin' ) && bp_is_action_variable( $extension_slug, 0 ) ) {   	) {
            	remove_filter( 'the_content', 'do_shortcode', 11);
          }
    }
    

    I was using the wrong priority on remove_filter, which always gets me. 🙂

    Thanks for your help!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] Get raw post output on group settings admin screen’ is closed to new replies.
Skip to toolbar