• Resolved circlesstudio

    (@circlesstudio)


    Great plugin! Love that you can specify what crop sizes apply to what post types!

    Because the site I’m building has some pages that rely heavily on custom fields and the content editor doesn’t make sense for them, I have hid the content editor on them in the Advanced Custom Fields field group settings.

    However, when I do this, the crop sizes button disappears. Is there a way to get it back without showing the content editor? A hook perhaps?

Viewing 1 replies (of 1 total)
  • Plugin Author Volkmar Kantor

    (@volkmar-kantor)

    Sorry for not answering that long.

    I just updated the plugin – its a generall rewrite of the modal code. You can open the modal-window on any location with the following code:

    
    //perform an action on the admin footer to execute a php function
    add_action('admin_footer', 'myCustomPhpFooterCode');
    function myCustomPhpFooterCode() {
    	//lets print some javascript code
    	?>
    	<script>
    	//add a button right beside the add media button - adjust if you want the button somewhere else
    	jQuery('#wp-content-media-buttons').append('<button type="button" id="myCustomButton" class="button">open Crop</button>');
    	
    	jQuery('#myCustomButton').click(function() {
    		/** 
    		 * the ID of the image you want to open
    		 * you may want to read the value by javascript from somewhere
    		 **/
    		var attachementId = 215;
    
    		/** the posttype decides what imagesizes should be visible **/
    		var postType = 'post';
    
    		/** the title of the modal dialog */
    		var title = 'test';
    
    		//lets open the crop-thumbnails-modal
    		var modal = new CROP_THUMBNAILS_VUE.modal();
    		modal.open(attachementId, postType, title);
    	});
    	</script>
    	<?php
    }
    
Viewing 1 replies (of 1 total)
  • The topic ‘is it possible to have crop sizes button without visual editor?’ is closed to new replies.