Plugin Directory

Changeset 3384720


Ignore:
Timestamp:
10/26/2025 12:39:31 PM (5 months ago)
Author:
multiwoomanager
Message:

Prepare release 1.2.2. new acf types and files upload not just images

Location:
multi-woo-manager/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • multi-woo-manager/trunk/README.txt

    r3377020 r3384720  
    66Tested up to: 6.7.1
    77Requires PHP: 8.0
    8 Stable tag: 1.2.1
     8Stable tag: 1.2.2
    99License: GPLv2 or later
    1010License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    5757== Changelog ==
    5858
     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
    5962= 1.2.1 =
    6063* 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  
    547547        $page     = $request->get_param('page') ? absint($request->get_param('page')) : 1;
    548548        $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        }
    554563
    555564        // Build subclauses for OR logic
     
    604613                $alt_text = get_post_meta($attachment->ID, '_wp_attachment_image_alt', true);
    605614                $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;
    606617
    607618                $results[] = array(
    608619                    'id'          => $attachment->ID,
    609620                    'src'         => $url,
    610                     'filename'    => basename(get_attached_file($attachment->ID)),
     621                    'filename'    => basename($file_path),
    611622                    'title'       => $attachment->post_title,
    612623                    'caption'     => $attachment->post_excerpt,
    613624                    'alt'         => $alt_text,  // Include alt text
    614625                    'description' => $attachment->post_content,
     626                    'mime_type'   => $attachment->post_mime_type,
     627                    'filesize'    => $file_size,
    615628                );
    616629            }
     
    769782        // Get the URL and filename.
    770783        $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.
    773789        $alt = get_post_meta($attachment_id, '_wp_attachment_image_alt', true);
    774790
    775791        $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,
    780798        );
    781799
  • multi-woo-manager/trunk/multi-woo-manager.php

    r3377020 r3384720  
    1818 * Plugin URI:        https://multiwoomanager.com
    1919 * 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.1
     20 * Version:           1.2.2
    2121 * Author:            MultiWooManager
    2222 * Author URI:        https://multiwoomanager.com/
     
    3232}
    3333
    34 define( 'MULTI_WOO_MANAGER_VERSION', '1.2.1' );
     34define( 'MULTI_WOO_MANAGER_VERSION', '1.2.2' );
    3535
    3636/**
Note: See TracChangeset for help on using the changeset viewer.