Changeset 1569105
- Timestamp:
- 01/06/2017 02:43:46 AM (9 years ago)
- Location:
- fx-builder/trunk
- Files:
-
- 8 edited
-
fx-builder.php (modified) (2 diffs)
-
includes/builder/assets/custom-css.css (modified) (2 diffs)
-
includes/builder/assets/switcher.css (modified) (1 diff)
-
includes/builder/builder.php (modified) (3 diffs)
-
includes/builder/front.php (modified) (1 diff)
-
includes/builder/revisions.php (modified) (4 diffs)
-
includes/builder/switcher.php (modified) (3 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
fx-builder/trunk/fx-builder.php
r1550216 r1569105 4 4 * Plugin URI: http://genbumedia.com/plugins/fx-builder/ 5 5 * Description: A simple page builder plugin. The one you can actually use. (Alpha Version) 6 * Version: 1.0. 06 * Version: 1.0.1 7 7 * Author: David Chandra Purnama 8 8 * Author URI: http://shellcreeper.com/ … … 25 25 define( 'FX_BUILDER_FILE', __FILE__ ); 26 26 define( 'FX_BUILDER_PLUGIN', plugin_basename( __FILE__ ) ); 27 define( 'FX_BUILDER_VERSION', '1.0. 0' );27 define( 'FX_BUILDER_VERSION', '1.0.1' ); 28 28 29 29 -
fx-builder/trunk/includes/builder/assets/custom-css.css
r1513094 r1569105 8 8 color: #555; 9 9 font-weight: 400; 10 margin-right: -14px;11 10 display: none; 12 11 } … … 14 13 float: left; 15 14 margin-right: 0; 16 margin-left: -14px;17 15 } 18 16 .fx_builder_active .fxb-nav-css{ -
fx-builder/trunk/includes/builder/assets/switcher.css
r1501728 r1569105 8 8 display: block !important; 9 9 } 10 .fx_builder_active #post-preview{ 11 display: none !important; 12 } -
fx-builder/trunk/includes/builder/builder.php
r1513094 r1569105 158 158 $request = stripslashes_deep( $_POST ); 159 159 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; 164 164 } 165 165 $post_type = get_post_type_object( $post->post_type ); 166 166 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; 168 172 } 169 173 170 174 /* Check Swicther 171 175 ------------------------------------------ */ 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 } 174 182 /* Page Builder Not Selected: Delete Data and Bail. */ 175 if( !$active ){ 183 else{ 184 delete_post_meta( $post_id, '_fxb_active' ); 176 185 delete_post_meta( $post_id, '_fxb_db_version' ); 177 186 delete_post_meta( $post_id, '_fxb_row_ids' ); … … 180 189 return false; 181 190 } 191 182 192 183 193 /* Page Builder Datas … … 254 264 remove_action( 'save_post', array( $this, __FUNCTION__ ) ); 255 265 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 258 269 259 270 /** -
fx-builder/trunk/includes/builder/front.php
r1513094 r1569105 39 39 */ 40 40 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 44 51 remove_filter( 'the_content', 'wpautop' ); 45 if( post_type_supports( $post_type, 'fx_builder' ) &&$active ){52 if( $active ){ 46 53 $content = Functions::content( $post_id ); // autop added in this function. 47 54 } -
fx-builder/trunk/includes/builder/revisions.php
r1504933 r1569105 44 44 $parent = get_post( $parent_id ); 45 45 46 $active = get_post_meta( $parent->ID, '_fxb_active', true ); 46 47 $db_version = get_post_meta( $parent->ID, '_fxb_db_version', true ); 47 48 $row_ids = get_post_meta( $parent->ID, '_fxb_row_ids', true ); … … 50 51 $css = get_post_meta( $parent->ID, '_fxb_custom_css', true ); 51 52 53 if ( $active ){ 54 add_metadata( 'post', $post_id, '_fxb_active', $active ); 55 } 52 56 if ( false !== $db_version ){ 53 57 add_metadata( 'post', $post_id, '_fxb_db_version', $db_version ); … … 77 81 $revision = get_post( $revision_id ); 78 82 83 $active = get_metadata( 'post', $revision->ID, '_fxb_active', true ); 79 84 $db_version = get_metadata( 'post', $revision->ID, '_fxb_db_version', true ); 80 85 $row_ids = get_metadata( 'post', $revision->ID, '_fxb_row_ids', true ); … … 82 87 $items = get_metadata( 'post', $revision->ID, '_fxb_items', true ); 83 88 $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 } 84 96 85 97 if ( false !== $db_version ){ -
fx-builder/trunk/includes/builder/switcher.php
r1504933 r1569105 7 7 /** 8 8 * Switcher: Toggle between page builder / wp editor. 9 * Since v.1.0.1 Switcher save method is added in builder.php 9 10 * @since 1.0.0 10 11 */ … … 30 31 /* Add Editor/Page Builder Tab */ 31 32 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 );35 33 36 34 /* Scripts */ … … 89 87 90 88 /** 91 * Save Switcher Pref92 * @since 1.0.093 */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 /**124 89 * Admin Scripts 125 90 * @since 1.0.0 -
fx-builder/trunk/readme.txt
r1550216 r1569105 5 5 Requires at least: 4.5 6 6 Tested up to: 4.7 7 Stable tag: 1.0. 07 Stable tag: 1.0.1 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 50 50 51 51 == 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. 52 59 53 60 = 1.0.0 - 09 Dec 2016 =
Note: See TracChangeset
for help on using the changeset viewer.