diff --git a/fx-builder.php b/fx-builder.php index 46e6d89..d35b922 100644 --- a/fx-builder.php +++ b/fx-builder.php @@ -3,7 +3,7 @@ * Plugin Name: f(x) Builder * Plugin URI: http://genbumedia.com/plugins/fx-builder/ * Description: A simple page builder plugin. The one you can actually use. (Alpha Version) - * Version: 1.0.1 + * Version: 1.0.2 * Author: David Chandra Purnama * Author URI: http://shellcreeper.com/ * License: GPLv2 or later @@ -24,7 +24,7 @@ define( 'FX_BUILDER_PATH', trailingslashit( plugin_dir_path( __FILE__ ) ) ); define( 'FX_BUILDER_FILE', __FILE__ ); define( 'FX_BUILDER_PLUGIN', plugin_basename( __FILE__ ) ); -define( 'FX_BUILDER_VERSION', '1.0.1' ); +define( 'FX_BUILDER_VERSION', '1.0.2' ); /* Init diff --git a/includes/builder/builder.php b/includes/builder/builder.php index 62a95c5..5ab68fa 100644 --- a/includes/builder/builder.php +++ b/includes/builder/builder.php @@ -151,7 +151,7 @@ public function load_templates( $post_id ){ * Save Page Builder Data * @since 1.0.0 */ - public function save( $post_id, $post = false ){ + public function save( $post_id, $post ){ /* Prepare ------------------------------------------ */ @@ -162,7 +162,6 @@ public function save( $post_id, $post = false ){ if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ){ return $post_id; } - if( ! $post ) return $post_id; $post_type = get_post_type_object( $post->post_type ); if ( !current_user_can( $post_type->cap->edit_post, $post_id ) ){ return $post_id; @@ -264,7 +263,7 @@ public function save( $post_id, $post = false ){ */ remove_action( 'save_post', array( $this, __FUNCTION__ ) ); wp_update_post( $this_post ); - add_action( 'save_post', array( $this, __FUNCTION__ ) ); + add_action( 'save_post', array( $this, __FUNCTION__ ), 10, 2 ); } diff --git a/readme.txt b/readme.txt index e122b8c..0bfa80f 100644 --- a/readme.txt +++ b/readme.txt @@ -55,6 +55,7 @@ You can contribute to development at GitHub https://github.com/turtlepod/fx-buil * Fix CSS Bug: Tools & CSS button position. * Store _fxb_active in revisions. * Hide "Preview Changes" button in "Publish" meta box when page builder active. +* Fix "save_post" hook to fix fatal error bug. = 1.0.0 - 09 Dec 2016 = * First Stable Release.