Plugin Directory

Changeset 2213940


Ignore:
Timestamp:
12/17/2019 11:31:34 PM (6 years ago)
Author:
pressupinc
Message:

deploy from git

Location:
require-featured-image/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • require-featured-image/trunk/readme.txt

    r2097499 r2213940  
    44Tags: featured image, images, edit, post, admin, require featured image, image, media, thumbnail, thumbnails, post thumbnail, photo, pictures
    55Requires at least: 3.5
    6 Tested up to: 5.2.1
    7 Stable tag: 1.4.1
     6Tested up to: 5.3.1
     7Stable tag: 1.5.0
    88License: MIT
    99License URI: http://opensource.org/licenses/MIT
     
    7070
    7171== 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.
    7275
    7376= 1.4.1 (2019.05.29) =
  • require-featured-image/trunk/require-featured-image.php

    r2097499 r2213940  
    55Description: Like it says on the tin: requires posts to have a featured image set before they'll be published.
    66Author: Press Up
    7 Version: 1.4.1
     7Version: 1.5.0
    88Author URI: http://pressupinc.com
    99Text Domain: require-featured-image
     
    1414add_action( 'transition_post_status', 'rfi_guard', 10, 3 );
    1515function 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    }
    1626    if ( $new_status === 'publish' && rfi_should_stop_post_publishing( $post ) ) {
    1727        // 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.