Skip to content

Commit

Permalink
Merge branch 'release/1-4-1'
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Silverstein committed Mar 15, 2019
2 parents 930b12a + b8ef4b3 commit 63af735
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All notable changes to this project will be documented in this file, per [the Keep a Changelog standard](http://keepachangelog.com/).

## [ 1.4.1 ] - 2019-03-15
### Fixed
* Improve block editor detection, correcting an issue with post saving.

## [ 1.4.0 ] - 2019-03-07
### Added
* Clearer instructions and help text when adding an external connection.
Expand Down
4 changes: 2 additions & 2 deletions distributor.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Plugin Name: Distributor
* Description: Makes it easy to syndicate and reuse content across your websites, whether inside of a multisite or across the web.
* Version: 1.4.0
* Version: 1.4.1
* Author: 10up Inc.
* Author URI: https://distributorplugin.com
* License: GPLv2 or later
Expand All @@ -17,7 +17,7 @@
exit; // Exit if accessed directly.
}

define( 'DT_VERSION', '1.4.0-dev' );
define( 'DT_VERSION', '1.4.1-dev' );
define( 'DT_PLUGIN_FILE', preg_replace( '#^.*plugins/(.*)$#i', '$1', __FILE__ ) );

// Define a constant if we're network activated to allow plugin to respond accordingly.
Expand Down
23 changes: 22 additions & 1 deletion includes/utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,28 @@ function is_using_gutenberg( $post ) {
return false;
}

return use_block_editor_for_post( $post );
/**
* WordPress 5.0 will do a check_admin_referrer() inside the use_block_editor_for_posts(),
* and this call would fail, returns a 404 if there's custom meta box, and kills the request.
*
* Unsetting the 'meta-box-loader' in the global request would bypass that check.
*/
if ( isset( $_GET['meta-box-loader'] ) ) {
$meta_box_loader = $_GET['meta-box-loader'];
unset( $_GET['meta-box-loader'] );
}

$use_block_editor = use_block_editor_for_post( $post );

/**
* Set the $meta_box_loader back to the request, if it exists
* so other areas that rely on it would still work.
*/
if ( isset( $meta_box_loader ) ) {
$_GET['meta-box-loader'] = $meta_box_loader;
}

return $use_block_editor;
}


Expand Down

0 comments on commit 63af735

Please sign in to comment.