Plugin Directory

Changeset 1569105


Ignore:
Timestamp:
01/06/2017 02:43:46 AM (9 years ago)
Author:
turtlepod
Message:

various bug fixes for 1.0.1

Location:
fx-builder/trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • fx-builder/trunk/fx-builder.php

    r1550216 r1569105  
    44 * Plugin URI: http://genbumedia.com/plugins/fx-builder/
    55 * Description: A simple page builder plugin. The one you can actually use. (Alpha Version)
    6  * Version: 1.0.0
     6 * Version: 1.0.1
    77 * Author: David Chandra Purnama
    88 * Author URI: http://shellcreeper.com/
     
    2525define( 'FX_BUILDER_FILE', __FILE__ );
    2626define( 'FX_BUILDER_PLUGIN', plugin_basename( __FILE__ ) );
    27 define( 'FX_BUILDER_VERSION', '1.0.0' );
     27define( 'FX_BUILDER_VERSION', '1.0.1' );
    2828
    2929
  • fx-builder/trunk/includes/builder/assets/custom-css.css

    r1513094 r1569105  
    88    color: #555;
    99    font-weight: 400;
    10     margin-right: -14px;
    1110    display: none;
    1211}
     
    1413    float: left;
    1514    margin-right: 0;
    16     margin-left: -14px;
    1715}
    1816.fx_builder_active .fxb-nav-css{
  • fx-builder/trunk/includes/builder/assets/switcher.css

    r1501728 r1569105  
    88    display: block !important;
    99}
     10.fx_builder_active #post-preview{
     11    display: none !important;
     12}
  • fx-builder/trunk/includes/builder/builder.php

    r1513094 r1569105  
    158158        $request = stripslashes_deep( $_POST );
    159159        if ( ! isset( $request['fxb_nonce'] ) || ! wp_verify_nonce( $request['fxb_nonce'], __FILE__ ) ){
    160             return false;
    161         }
    162         if( defined('DOING_AUTOSAVE' ) && DOING_AUTOSAVE ){
    163             return false;
     160            return $post_id;
     161        }
     162        if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ){
     163            return $post_id;
    164164        }
    165165        $post_type = get_post_type_object( $post->post_type );
    166166        if ( !current_user_can( $post_type->cap->edit_post, $post_id ) ){
    167             return false;
     167            return $post_id;
     168        }
     169        $wp_preview = isset( $request['wp-preview'] ) ? esc_attr( $request['wp-preview'] ) : false;
     170        if( $wp_preview ){
     171            return $post_id;
    168172        }
    169173
    170174        /* Check Swicther
    171175        ------------------------------------------ */
    172         $active = get_post_meta( $post_id, '_fxb_active', true );
    173 
     176        $active = isset( $request['_fxb_active'] ) ? $request['_fxb_active'] : false;
     177
     178        /* Page Builder Active */
     179        if( $active ){
     180            update_post_meta( $post_id, '_fxb_active', 1 );
     181        }
    174182        /* Page Builder Not Selected: Delete Data and Bail. */
    175         if( !$active ){
     183        else{
     184            delete_post_meta( $post_id, '_fxb_active' );
    176185            delete_post_meta( $post_id, '_fxb_db_version' );
    177186            delete_post_meta( $post_id, '_fxb_row_ids' );
     
    180189            return false;
    181190        }
     191
    182192
    183193        /* Page Builder Datas
     
    254264        remove_action( 'save_post', array( $this, __FUNCTION__ ) );
    255265        wp_update_post( $this_post );
    256         add_action( 'save_post', array( $this, __FUNCTION__ ) );
    257     }
     266        add_action( 'save_post', array( $this, __FUNCTION__ ), 10, 2 );
     267    }
     268
    258269
    259270    /**
  • fx-builder/trunk/includes/builder/front.php

    r1513094 r1569105  
    3939     */
    4040    public function content_filter( $content ){
    41         $post_id      = get_the_ID();
    42         $post_type    = get_post_type( $post_id );
    43         $active       = get_post_meta( $post_id, '_fxb_active', true );
     41
     42        /* Check Post Support */
     43        $post_id   = get_the_ID();
     44        $post_type = get_post_type( $post_id );
     45        if( ! post_type_supports( $post_type, 'fx_builder' ) ){
     46            return $content;
     47        }
     48
     49        $active = get_post_meta( $post_id, '_fxb_active', true );
     50
    4451        remove_filter( 'the_content', 'wpautop' );
    45         if( post_type_supports( $post_type, 'fx_builder' ) && $active ){
     52        if( $active ){
    4653            $content = Functions::content( $post_id ); // autop added in this function.
    4754        }
  • fx-builder/trunk/includes/builder/revisions.php

    r1504933 r1569105  
    4444            $parent     = get_post( $parent_id );
    4545
     46            $active     = get_post_meta( $parent->ID, '_fxb_active', true );
    4647            $db_version = get_post_meta( $parent->ID, '_fxb_db_version', true );
    4748            $row_ids    = get_post_meta( $parent->ID, '_fxb_row_ids', true );
     
    5051            $css        = get_post_meta( $parent->ID, '_fxb_custom_css', true );
    5152
     53            if ( $active ){
     54                add_metadata( 'post', $post_id, '_fxb_active', $active );
     55            }
    5256            if ( false !== $db_version ){
    5357                add_metadata( 'post', $post_id, '_fxb_db_version', $db_version );
     
    7781        $revision   = get_post( $revision_id );
    7882
     83        $active     = get_metadata( 'post', $revision->ID, '_fxb_active', true );
    7984        $db_version = get_metadata( 'post', $revision->ID, '_fxb_db_version', true );
    8085        $row_ids    = get_metadata( 'post', $revision->ID, '_fxb_row_ids', true );
     
    8287        $items      = get_metadata( 'post', $revision->ID, '_fxb_items', true );
    8388        $css        = get_metadata( 'post', $revision->ID, '_fxb_custom_css', true );
     89
     90        if ( $active ){
     91            update_post_meta( $post_id, '_fxb_active', $active );
     92        }
     93        else{
     94            delete_post_meta( $post_id, '_fxb_active' );
     95        }
    8496
    8597        if ( false !== $db_version ){
  • fx-builder/trunk/includes/builder/switcher.php

    r1504933 r1569105  
    77/**
    88 * Switcher: Toggle between page builder / wp editor.
     9 * Since v.1.0.1 Switcher save method is added in builder.php
    910 * @since 1.0.0
    1011 */
     
    3031        /* Add Editor/Page Builder Tab */
    3132        add_action( 'edit_form_after_title', array( $this, 'editor_toggle' ) );
    32 
    33         /* Save Switcher Preference */
    34         add_action( 'save_post', array( $this, 'save' ), 9, 2 );
    3533
    3634        /* Scripts */
     
    8987
    9088    /**
    91      * Save Switcher Pref
    92      * @since 1.0.0
    93      */
    94     public function save( $post_id, $post ){
    95         $request = stripslashes_deep( $_POST );
    96         if ( ! isset( $request['fxb_switcher_nonce'] ) || ! wp_verify_nonce( $request['fxb_switcher_nonce'], __FILE__ ) ){
    97             return false;
    98         }
    99         if( defined('DOING_AUTOSAVE' ) && DOING_AUTOSAVE ){
    100             return false;
    101         }
    102         $post_type = get_post_type_object( $post->post_type );
    103         if ( !current_user_can( $post_type->cap->edit_post, $post_id ) ){
    104             return false;
    105         }
    106 
    107         /* Save Builder Tab */
    108         if( isset( $request['_fxb_active'] ) ){
    109             $new_data = $request['_fxb_active'] ? 1 : 0;
    110             if( $new_data ){
    111                 update_post_meta( $post_id, '_fxb_active', 1 );
    112             }
    113             else{
    114                 delete_post_meta( $post_id, '_fxb_active' );
    115             }
    116         }
    117         else{
    118             delete_post_meta( $post_id, '_fxb_active' );
    119         }
    120     }
    121 
    122 
    123     /**
    12489     * Admin Scripts
    12590     * @since 1.0.0
  • fx-builder/trunk/readme.txt

    r1550216 r1569105  
    55Requires at least: 4.5
    66Tested up to: 4.7
    7 Stable tag: 1.0.0
     7Stable tag: 1.0.1
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    5050
    5151== Changelog ==
     52
     53= 1.0.1 - 06 Jan 2017 =
     54* Fix bug: wp preview remove page builder data https://github.com/turtlepod/fx-builder/issues/45
     55* Fix CSS Bug: Tools & CSS button position.
     56* Store _fxb_active in revisions.
     57* Hide "Preview Changes" button in  "Publish" meta box when page builder active.
     58* Fix "save_post" hook to fix fatal error bug.
    5259
    5360= 1.0.0 - 09 Dec 2016 =
Note: See TracChangeset for help on using the changeset viewer.