Changeset 1971878
- Timestamp:
- 11/09/2018 11:50:36 PM (7 years ago)
- Location:
- require-featured-image/trunk
- Files:
-
- 3 edited
-
readme.txt (modified) (2 diffs)
-
require-featured-image-on-edit.js (modified) (3 diffs)
-
require-featured-image.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
require-featured-image/trunk/readme.txt
r1714373 r1971878 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: 4. 8.17 Stable tag: 1. 3.06 Tested up to: 4.9.8 7 Stable tag: 1.4.0 8 8 License: MIT 9 9 License URI: http://opensource.org/licenses/MIT … … 70 70 71 71 == CHANGELOG == 72 73 = 1.4.0 (2018.11.09) = 74 * Crude-and-quick Gutenberg compatibility 72 75 73 76 = 1.3.0 (2017.08.16) = -
require-featured-image/trunk/require-featured-image-on-edit.js
r1714373 r1971878 1 1 jQuery(document).ready(function($) { 2 2 3 function isGutenberg() { 4 return ($('.gutenberg').length > 0); 5 } 6 3 7 function checkImageReturnWarningMessageOrEmpty() { 4 var $img = $('#postimagediv').find('img'); 8 if (isGutenberg()) { 9 var $img = $('.editor-post-featured-image').find('img'); 10 } else { 11 var $img = $('#postimagediv').find('img'); 12 } 5 13 if ($img.length === 0) { 6 14 return passedFromServer.jsWarningHtml; … … 17 25 function featuredImageIsTooSmall() { 18 26 // A weird polling issue in Chrome made this necessary 19 var $img = $('#postimagediv').find('img'); 20 27 if (isGutenberg()) { 28 var $img = $('.editor-post-featured-image').find('img'); 29 } else { 30 var $img = $('#postimagediv').find('img'); 31 } 21 32 // pop one off, if needed 22 33 if( isTooSmallTrials.length > 2 ) { … … 45 56 $('#nofeature-message').addClass("error") 46 57 .html('<p>'+message+'</p>'); 47 $('#publish').attr('disabled','disabled'); 58 if (isGutenberg()) { 59 $('.editor-post-publish-panel__toggle').attr('disabled', 'disabled'); 60 } else { 61 $('#publish').attr('disabled','disabled'); 62 } 48 63 } 49 64 50 65 function clearWarningAndEnablePublish() { 51 66 $('#nofeature-message').remove(); 52 $('#publish').removeAttr('disabled'); 67 if (isGutenberg()) { 68 $('.editor-post-publish-panel__toggle').removeAttr('disabled'); 69 } else { 70 $('#publish').removeAttr('disabled'); 71 } 53 72 } 54 73 55 74 function createMessageAreaIfNeeded() { 56 75 if ($('body').find("#nofeature-message").length === 0) { 57 $('#post').before('<div id="nofeature-message"></div>'); 76 if (isGutenberg()) { 77 $('.components-notice-list').append('<div id="nofeature-message"></div>'); 78 } else { 79 $('#post').before('<div id="nofeature-message"></div>'); 80 } 58 81 } 59 82 } -
require-featured-image/trunk/require-featured-image.php
r1714373 r1971878 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. 3.07 Version: 1.4.0 8 8 Author URI: http://pressupinc.com 9 9 Text Domain: require-featured-image
Note: See TracChangeset
for help on using the changeset viewer.