Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make compatible with WP-CLI "wp media regenerate' #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Make compatible with WP-CLI "wp media regenerate' #22

wants to merge 1 commit into from

Conversation

jmslbam
Copy link

@jmslbam jmslbam commented Jun 8, 2017

As suggested in #21, the included is missing. But instead of including the class-meauh-admin.php I just include the logic from includes/class-meauh-attachment.php because the admin file includes enqueueing JS file which isn't needed.

Fixes #21

As suggested in #21, the included is missing. But instead of including the `class-meauh-admin.php` I just include the logic from `includes/class-meauh-attachment.php` because the admin file includes enqueueing JS file which isn't needed.

Fixes #21
@benplum benplum mentioned this pull request Dec 7, 2017
@Jaska
Copy link

Jaska commented May 29, 2019

Could this be merged? "Plugin Compatibility" -commit did not enable wp-cli media regenerate to crop images according to added MEAUH hotspots but this commit fixed it.

@jmslbam
Copy link
Author

jmslbam commented May 30, 2019

Wow totally forgot about this one, hope it still lands, because it's a small fix and a big win for the plugin. Ciao!

@dougaxe1
Copy link

We've been using this as an MU plugin until this PR lands (wp-cli-my-eyes-are-up-here.php):

<?php
/**
 * Patches My Eyes Are Up Here (MEAUH) to be compatible with the WP-CLI 'wp media regenerate' command
 */
if ( defined('WP_CLI') && WP_CLI ) {
	add_action( 'init', function() {
		if ( class_exists( 'MyEyesAreUpHere' ) && ! class_exists( 'MEAUH_Attachment' ) ) {
			$attachment_class = WP_PLUGIN_DIR . '/my-eyes-are-up-here/includes/class-meauh-attachment.php';
			if ( file_exists( $attachment_class ) ) {
				require_once $attachment_class;
			}
		}
	});
}

@markhowellsmead
Copy link

@dougaxe1 I've just come across the fix you mentioned above and it works fine for me with the current version of both the plugin and WordPress Core. However, the same problem is evident when using the Regenerate Thumbnails plugin (not WP CLI). Have you come across this problem, and have you a suggestion on whether the fix for this combination could also be as simple?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

MEAUH_Attachment class not loaded by wp-cli
5 participants