Skip to content

Commit

Permalink
fix fatal error bug in save_post hook. update readme.
Browse files Browse the repository at this point in the history
  • Loading branch information
turtlepod committed Jan 6, 2017
1 parent 44e25a3 commit 303a689
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions fx-builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
5 changes: 2 additions & 3 deletions includes/builder/builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
------------------------------------------ */
Expand All @@ -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;
Expand Down Expand Up @@ -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 );
}


Expand Down
1 change: 1 addition & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 303a689

Please sign in to comment.