Skip to content

Commit

Permalink
Merge pull request #11 from vollyimnetz/dev
Browse files Browse the repository at this point in the history
bugfix: hide disabled image-sizes in the crop-editor again
  • Loading branch information
vollyimnetz committed Sep 1, 2016
2 parents a24ffea + 8154505 commit 25afd89
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
4 changes: 2 additions & 2 deletions crop-thumbnails.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Plugin URI: http://wordpress.org/extend/plugins/crop-thumbnails/
* Author: Volkmar Kantor
* Author URI: http://www.totalmedial.de
* Version: 0.10.10
* Version: 0.10.11
* Description: Crop your thumbnails, the easy way.
* Text Domain: crop-thumbnails
*
Expand All @@ -27,7 +27,7 @@

//cpt - stands for crop-post-thumbnail
define('CROP_THUMBS_LANG','cpt_lang');
define('CROP_THUMBS_VERSION','0.10.10');
define('CROP_THUMBS_VERSION','0.10.11');

function cpt_plugin_init() {
load_plugin_textdomain( CROP_THUMBS_LANG, false, dirname( plugin_basename( __FILE__ ) ) . '/lang/' );
Expand Down
2 changes: 1 addition & 1 deletion functions/backendpreparer.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ function handleFeaturedImageBox() {

var featuredImageLinkButton = '';
featuredImageLinkButton+= '<p class="cropFeaturedImageWrap hidden">';
featuredImageLinkButton+= '<a class="button cropThumbnailsLink" href="#" data-cropthumbnail=\'{"image_id":'+ parseInt(wp.media.featuredImage.get()) +',"viewmode":"single"}\' title="<?php esc_attr_e('Crop Featured Image',CROP_THUMBS_LANG) ?>">';
featuredImageLinkButton+= '<a class="button cropThumbnailsLink" href="#" data-cropthumbnail=\'{"image_id":'+ parseInt(wp.media.featuredImage.get()) +',"viewmode":"single","posttype":"<?php echo get_post_type(); ?>"}\' title="<?php esc_attr_e('Crop Featured Image',CROP_THUMBS_LANG) ?>">';
featuredImageLinkButton+= '<span class="wp-media-buttons-icon"></span> <?php esc_html_e('Crop Featured Image',CROP_THUMBS_LANG); ?>';
featuredImageLinkButton+= '</a>';
baseElem.find('.inside').after( $(featuredImageLinkButton) );
Expand Down
7 changes: 6 additions & 1 deletion functions/editor.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,11 @@ function listImages() {
* Display the crop editor.
* @param $_REQUEST['image_id'] - ID of the image to show
* @param $_REQUEST['viewmode']=='single' - without the back-link
* @param $_REQUEST['posttype']=='page' - (optional) will be used to hide certain image sizes (default: '')
*/
function byImageId() {
global $cptSettings,$content_width;

//make sure $content_width is out of the way
$_remember_content_width = $content_width;
$content_width = null;
Expand All @@ -159,6 +160,10 @@ function byImageId() {
$current_parent_post_id = $_tmp->ID;
}
}

if(!empty($_REQUEST['posttype']) && post_type_exists($_REQUEST['posttype'])) {
$current_parent_post_type = $_REQUEST['posttype'];
}

$all_image_sizes = $cptSettings->getImageSizes();
$this->addDebug('all_image_sizes', print_r($all_image_sizes,true));
Expand Down
3 changes: 3 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ If you fork and planning to publish the forked plugin, please contact me.
6. Quicktest on settings-page, to check if your system is correct setup.

== Changelog ==
= 0.10.11 =
* bugfix: hide disabled image-sizes in the crop-editor again

= 0.10.10 =
* bugfix: Checks if the current page have a featured image box in the first place

Expand Down

0 comments on commit 25afd89

Please sign in to comment.