Changeset 3384720
- Timestamp:
- 10/26/2025 12:39:31 PM (5 months ago)
- Location:
- multi-woo-manager/trunk
- Files:
-
- 3 edited
-
README.txt (modified) (2 diffs)
-
admin/class-multi-woo-manager-admin.php (modified) (3 diffs)
-
multi-woo-manager.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
multi-woo-manager/trunk/README.txt
r3377020 r3384720 6 6 Tested up to: 6.7.1 7 7 Requires PHP: 8.0 8 Stable tag: 1.2. 18 Stable tag: 1.2.2 9 9 License: GPLv2 or later 10 10 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 57 57 == Changelog == 58 58 59 = 1.2.2 = 60 * Added compatibility with ACF fields: select, file & Allow import of different files such as PDFs instead of only images via MultiWooManager app Media Selector 61 59 62 = 1.2.1 = 60 63 * Added Smart Image synchronization compatibility for ACF image fields, fixed product synchronization bugs & ACF repeater field Ai translations. -
multi-woo-manager/trunk/admin/class-multi-woo-manager-admin.php
r3377020 r3384720 547 547 $page = $request->get_param('page') ? absint($request->get_param('page')) : 1; 548 548 $offset = ($page - 1) * $per_page; 549 550 // Base WHERE clause for attachments, images, 'inherit' status. 551 $where_clause = "WHERE post_type = 'attachment' 552 AND post_status = 'inherit' 553 AND post_mime_type LIKE 'image/%'"; 549 $media_type = sanitize_text_field($request->get_param('media_type')) ?: 'image'; // 'image' or 'all' 550 551 // Base WHERE clause for attachments with 'inherit' status 552 // Filter by mime type based on media_type parameter 553 if ($media_type === 'all') { 554 // All attachment types 555 $where_clause = "WHERE post_type = 'attachment' 556 AND post_status = 'inherit'"; 557 } else { 558 // Only images (default behavior) 559 $where_clause = "WHERE post_type = 'attachment' 560 AND post_status = 'inherit' 561 AND post_mime_type LIKE 'image/%'"; 562 } 554 563 555 564 // Build subclauses for OR logic … … 604 613 $alt_text = get_post_meta($attachment->ID, '_wp_attachment_image_alt', true); 605 614 $url = wp_get_attachment_url($attachment->ID); 615 $file_path = get_attached_file($attachment->ID); 616 $file_size = file_exists($file_path) ? filesize($file_path) : 0; 606 617 607 618 $results[] = array( 608 619 'id' => $attachment->ID, 609 620 'src' => $url, 610 'filename' => basename( get_attached_file($attachment->ID)),621 'filename' => basename($file_path), 611 622 'title' => $attachment->post_title, 612 623 'caption' => $attachment->post_excerpt, 613 624 'alt' => $alt_text, // Include alt text 614 625 'description' => $attachment->post_content, 626 'mime_type' => $attachment->post_mime_type, 627 'filesize' => $file_size, 615 628 ); 616 629 } … … 769 782 // Get the URL and filename. 770 783 $src = wp_get_attachment_url($attachment_id); 771 $filename = basename(get_attached_file($attachment_id)); 772 // Optionally retrieve alt text. 784 $file_path = get_attached_file($attachment_id); 785 $filename = basename($file_path); 786 $file_size = file_exists($file_path) ? filesize($file_path) : 0; 787 788 // Retrieve alt text. 773 789 $alt = get_post_meta($attachment_id, '_wp_attachment_image_alt', true); 774 790 775 791 $media = array( 776 'id' => $attachment_id, 777 'src' => $src, 778 'filename' => $filename, 779 'alt' => $alt, 792 'id' => $attachment_id, 793 'src' => $src, 794 'filename' => $filename, 795 'alt' => $alt, 796 'mime_type' => $attachment->post_mime_type, 797 'filesize' => $file_size, 780 798 ); 781 799 -
multi-woo-manager/trunk/multi-woo-manager.php
r3377020 r3384720 18 18 * Plugin URI: https://multiwoomanager.com 19 19 * Description: WooCommerce products management, the easy way. Plugin extends WooCommerce REST API in order to provide optimized API routes for product management. 20 * Version: 1.2. 120 * Version: 1.2.2 21 21 * Author: MultiWooManager 22 22 * Author URI: https://multiwoomanager.com/ … … 32 32 } 33 33 34 define( 'MULTI_WOO_MANAGER_VERSION', '1.2. 1' );34 define( 'MULTI_WOO_MANAGER_VERSION', '1.2.2' ); 35 35 36 36 /**
Note: See TracChangeset
for help on using the changeset viewer.