Changeset 2213940
- Timestamp:
- 12/17/2019 11:31:34 PM (6 years ago)
- Location:
- require-featured-image/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (2 diffs)
-
require-featured-image.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
require-featured-image/trunk/readme.txt
r2097499 r2213940 4 4 Tags: featured image, images, edit, post, admin, require featured image, image, media, thumbnail, thumbnails, post thumbnail, photo, pictures 5 5 Requires at least: 3.5 6 Tested up to: 5. 2.17 Stable tag: 1. 4.16 Tested up to: 5.3.1 7 Stable tag: 1.5.0 8 8 License: MIT 9 9 License URI: http://opensource.org/licenses/MIT … … 70 70 71 71 == CHANGELOG == 72 73 = 1.5.0 (2019.12.17) = 74 * It was impossible to publish a post (which was never saved as a "Draft") because of the server-side check. It is no longer. 72 75 73 76 = 1.4.1 (2019.05.29) = -
require-featured-image/trunk/require-featured-image.php
r2097499 r2213940 5 5 Description: Like it says on the tin: requires posts to have a featured image set before they'll be published. 6 6 Author: Press Up 7 Version: 1. 4.17 Version: 1.5.0 8 8 Author URI: http://pressupinc.com 9 9 Text Domain: require-featured-image … … 14 14 add_action( 'transition_post_status', 'rfi_guard', 10, 3 ); 15 15 function rfi_guard( $new_status, $old_status, $post ) { 16 if ( isset($_GET['_locale']) && $_GET['_locale'] == 'user' ) { 17 return; 18 /* EXPLANATION: The Block/Gutenberg editor works differently than classic, 19 * especially when a user has a a new post they're seeking to see published 20 * where the Featured Image wasn't already saved to a draft. Best I can tell 21 * in that condition they'll always have this weird `_locale=user` set on the URL 22 * so a quick-and-dirty hack on not enforcing on that post transition is going on 23 * here. Should probably have more expert eyes find a better solution than this. 24 */ 25 } 16 26 if ( $new_status === 'publish' && rfi_should_stop_post_publishing( $post ) ) { 17 27 // transition_post_status comes after the post has changed statuses, so we must roll back here
Note: See TracChangeset
for help on using the changeset viewer.