Plugin Directory

Changeset 1239252


Ignore:
Timestamp:
09/06/2015 08:32:48 PM (11 years ago)
Author:
RylanH
Message:

Fix for WordPress's balance XHTML tag setting which messes up <post-publisher> and other custom elements

File:
1 edited

Legend:

Unmodified
Added
Removed
  • storyform/trunk/class-storyform-editor-page.php

    r1237746 r1239252  
    159159        $template   = sanitize_text_field( $_POST['template'] );
    160160        $post_type  = sanitize_text_field( $_POST['post_type'] );
     161
     162        add_filter( 'pre_option_use_balanceTags', array( $this, 'avoid_balance_tags' ) );
    161163       
    162164        $post = array(
     
    182184        $id = sanitize_text_field( $_POST['id'] );
    183185        $template = isset( $_POST['template'] ) ? sanitize_text_field( $_POST['template'] ) : null;
     186
     187        add_filter( 'pre_option_use_balanceTags', array( $this, 'avoid_balance_tags' ) );
    184188
    185189        // Check if we've already published, if so create revision
     
    247251        Storyform_Options::get_instance()->update_storyform_version_for_post( $post['ID'], false );
    248252
    249 
    250253        echo json_encode( array( $post ) );
    251254        die();
     255    }
     256
     257    /**
     258     *  Unfortunately WordPress's balance XHTML tags setting doesn't allow for <post-publisher> or other custom elements
     259     *
     260     */
     261    public function avoid_balance_tags( $balance ){
     262        return 0;
    252263    }
    253264
     
    283294            die( 'Invalid Nonce' );
    284295        }       
     296
     297        add_filter( 'pre_option_use_balanceTags', array( $this, 'avoid_balance_tags' ) );
    285298
    286299        // Update post with revision if already published, keep name
Note: See TracChangeset for help on using the changeset viewer.