plugin updates
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
Plugin URI: http://www.joomunited.com
|
||||
Description: WP media Folder is a WordPress plugin that enhance the WordPress media manager by adding a folder manager inside.
|
||||
Author: Joomunited
|
||||
Version: 5.9.12
|
||||
Version: 5.9.13
|
||||
Update URI: https://www.joomunited.com/juupdater_files/wp-media-folder.json
|
||||
Author URI: http://www.joomunited.com
|
||||
Text Domain: wpmf
|
||||
@@ -79,7 +79,7 @@ if (!defined('WPMF_TAXO')) {
|
||||
define('_WPMF_GALLERY_PREFIX', '_wpmf_gallery_');
|
||||
define('WPMF_PLUGIN_URL', plugin_dir_url(__FILE__));
|
||||
define('WPMF_DOMAIN', 'wpmf');
|
||||
define('WPMF_VERSION', '5.9.12');
|
||||
define('WPMF_VERSION', '5.9.13');
|
||||
define('WPMF_HIDE_USER_MEDIA_FOLDER_ROOT', true);
|
||||
|
||||
// disable warning function _load_textdomain_just_in_time was called incorrectly
|
||||
@@ -1143,7 +1143,7 @@ function wpmfVcBeforeInit()
|
||||
);
|
||||
wp_enqueue_style(
|
||||
'wpmf-bakery-display-gallery-style',
|
||||
WPMF_PLUGIN_URL . '/assets/css/display-gallery/style-display-gallery.css',
|
||||
WPMF_PLUGIN_URL . 'assets/css/display-gallery/style-display-gallery.css',
|
||||
array(),
|
||||
WPMF_VERSION
|
||||
);
|
||||
@@ -2023,3 +2023,36 @@ function wpmfTagRegisterTaxonomy()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (class_exists('WooCommerce')) {
|
||||
$option_image_watermark = get_option('wpmf_option_image_watermark');
|
||||
$option_watermark_only_woo = get_option('wpmf_watermark_only_woo');
|
||||
if (!empty($option_image_watermark) && (int) $option_image_watermark === 1 && !empty($option_watermark_only_woo) && (int) $option_watermark_only_woo === 1) {
|
||||
add_action('woocommerce_new_product', 'wpmfCreateWatermarkAfterProductSave', 10, 1);
|
||||
add_action('woocommerce_update_product', 'wpmfCreateWatermarkAfterProductSave', 10, 1);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create watermark image after product creation or product update
|
||||
*
|
||||
* @param integer $product_id Current product ID.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function wpmfCreateWatermarkAfterProductSave($product_id)
|
||||
{
|
||||
$product = wc_get_product($product_id);
|
||||
$main_image_id = get_post_thumbnail_id($product_id);
|
||||
$gallery_image_ids = $product->get_gallery_image_ids();
|
||||
|
||||
$all_image_ids = array_merge([$main_image_id], $gallery_image_ids);
|
||||
|
||||
require_once(WP_MEDIA_FOLDER_PLUGIN_DIR . 'class/class-image-watermark.php');
|
||||
$wpmfwatermark = new WpmfWatermark();
|
||||
|
||||
foreach ($all_image_ids as $image_id) {
|
||||
$metadata = wp_get_attachment_metadata($image_id);
|
||||
$wpmfwatermark->createWatermarkImage($metadata, $image_id, true);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user