Closed alpipego closed 6 years ago
Temporary workaround:
$paymentMethods = get_option('edd_settings')['accepted_cards'];
array_walk($paymentMethods, function ($method) {
$method = preg_replace('/\h/', '', strtolower($method));
add_filter('edd_accepted_payment_' . $method . '_image', function () use ($method) {
$image = edd_locate_template('images/icons/' . $method . '.png', false);
$content_dir = WP_PLUGIN_DIR;
if (function_exists('wp_normalize_path')) {
// Replaces backslashes with forward slashes for Windows systems
$image = wp_normalize_path($image);
$content_dir = wp_normalize_path($content_dir);
}
$src = str_replace($content_dir, WP_PLUGIN_URL, $image);
return $src;
});
});
In my setup, the
WP_PLUGIN_DIR
is not inside myWP_CONTENT_DIR
(but on the same level). I do not have any images/icons, e.g., payment icons in my theme dir.In https://github.com/easydigitaldownloads/easy-digital-downloads/blob/master/includes/checkout/template.php#L694, for example, you're trying to replace the plugins path with the
content_url()
. But since the plugins dir does not have to be inside theWP_CONTENT_DIR
this will not work in all non-default setups.