Plugin Directory

Changeset 3113637


Ignore:
Timestamp:
07/06/2024 10:09:56 PM (21 months ago)
Author:
Ickata
Message:

Fixed inability to batch/multiple edit more than ~20 media files

Location:
image-editor-by-pixo
Files:
2 edited
8 copied

Legend:

Unmodified
Added
Removed
  • image-editor-by-pixo/tags/2.3.3/pixo.php

    r3086913 r3113637  
    44Plugin URI: https://pixoeditor.com
    55Description: Provides Pixo as a replacement of the default image editor in your WordPress installation, as well as integrates to your website front-end
    6 Version: 2.3.2
     6Version: 2.3.3
    77*/
    88
     
    130130      Pixo.LOCALE = '" . str_replace( '_', '-', get_locale() ) . "';
    131131      Pixo.OPTIONS_URL = '" . PIXOEDITOR_OPTIONS_URL . "';
    132       Pixo.PARAM_BATCH = '" . PIXOEDITOR_PARAM_BATCH . "';
    133       Pixo.PARAM_MULTI = '" . PIXOEDITOR_PARAM_MULTI . "';
    134132      Pixo.ACTIONS     = Pixo.ACTIONS || {};
    135133      Pixo.ACTIONS." . PIXOEDITOR_ACTION_SAVE_NEW . " = '" . PIXOEDITOR_ACTION_SAVE_NEW . "';
     
    149147      );
    150148     
    151       (function () {
    152       const params = Pixo.getSearchParams();
    153       const batch_queue = params[ Pixo.PARAM_BATCH ];
    154       const multi_queue = params[ Pixo.PARAM_MULTI ];
    155       if (batch_queue) {
    156          Pixo.batchEdit( JSON.parse( decodeURIComponent( batch_queue ) ), function () {
    157             delete params[ Pixo.PARAM_BATCH ];
     149      " . pixoeditor__printBatchEditScript(PIXOEDITOR_PARAM_BATCH) . pixoeditor__printBatchEditScript(PIXOEDITOR_PARAM_MULTI) . "
     150   </script>";
     151}
     152
     153function pixoeditor__printBatchEditScript($param) {
     154   if (!isset($_GET[ $param ]) || !$_GET[ $param ]) {
     155      return '';
     156   }
     157
     158   $args = json_encode(array_map('pixoeditor__resolveImageSrc', explode(',', $_GET[$param])));
     159   $method = $param === PIXOEDITOR_PARAM_BATCH ? 'batchEdit' : 'editMultiple';
     160
     161   return "
     162         Pixo.$method( $args, function () {
     163            const params = Pixo.getSearchParams();
     164            delete params[ '$param' ];
    158165            location.search = Pixo.buildSearchParams( params );
    159166         });
    160       }
    161       if (multi_queue) {
    162          Pixo.editMultiple( JSON.parse( decodeURIComponent( multi_queue ) ), function () {
    163             delete params[ Pixo.PARAM_MULTI ];
    164             location.search = Pixo.buildSearchParams( params );
    165          });
    166       }
    167       })();
    168    </script>";
     167   ";
    169168}
    170169
     
    209208      return add_query_arg(
    210209         PIXOEDITOR_PARAM_BATCH,
    211          rawurlencode( json_encode( array_map( 'pixoeditor__resolveImageSrc', $post_ids ) ) ),
     210         implode( ',', $post_ids ),
    212211         $redirect_to
    213212      );
     
    216215      return add_query_arg(
    217216         PIXOEDITOR_PARAM_MULTI,
    218          rawurlencode( json_encode( array_map( 'pixoeditor__resolveImageSrc', $post_ids ) ) ),
     217         implode( ',', $post_ids ),
    219218         $redirect_to
    220219      );
     
    422421
    423422         <?php
    424          $active_tab = $_GET[ PIXOEDITOR_QUERY_VAR_TAB ] ? $_GET[ PIXOEDITOR_QUERY_VAR_TAB ] : PIXOEDITOR_TAB_ADMIN;
     423         $active_tab = isset( $_GET[ PIXOEDITOR_QUERY_VAR_TAB ] ) ? $_GET[ PIXOEDITOR_QUERY_VAR_TAB ] : PIXOEDITOR_TAB_ADMIN;
    425424         ?>
    426425
  • image-editor-by-pixo/tags/2.3.3/readme.txt

    r3086913 r3113637  
    55Requires at least: 3.5
    66Tested up to: 6.5
    7 Stable tag: 2.3.2
     7Stable tag: 2.3.3
    88Requires PHP: 5.2
    99License: GPLv2 or later
     
    104104
    105105== Changelog ==
     106= 2.3.3 =
     107* Fixed inability to batch/multiple edit more than ~20 media files
     108
    106109= 2.3.2 =
    107110* Fixed issue when editing older (uploaded long time ago) files
  • image-editor-by-pixo/trunk/pixo.php

    r3086913 r3113637  
    44Plugin URI: https://pixoeditor.com
    55Description: Provides Pixo as a replacement of the default image editor in your WordPress installation, as well as integrates to your website front-end
    6 Version: 2.3.2
     6Version: 2.3.3
    77*/
    88
     
    130130      Pixo.LOCALE = '" . str_replace( '_', '-', get_locale() ) . "';
    131131      Pixo.OPTIONS_URL = '" . PIXOEDITOR_OPTIONS_URL . "';
    132       Pixo.PARAM_BATCH = '" . PIXOEDITOR_PARAM_BATCH . "';
    133       Pixo.PARAM_MULTI = '" . PIXOEDITOR_PARAM_MULTI . "';
    134132      Pixo.ACTIONS     = Pixo.ACTIONS || {};
    135133      Pixo.ACTIONS." . PIXOEDITOR_ACTION_SAVE_NEW . " = '" . PIXOEDITOR_ACTION_SAVE_NEW . "';
     
    149147      );
    150148     
    151       (function () {
    152       const params = Pixo.getSearchParams();
    153       const batch_queue = params[ Pixo.PARAM_BATCH ];
    154       const multi_queue = params[ Pixo.PARAM_MULTI ];
    155       if (batch_queue) {
    156          Pixo.batchEdit( JSON.parse( decodeURIComponent( batch_queue ) ), function () {
    157             delete params[ Pixo.PARAM_BATCH ];
     149      " . pixoeditor__printBatchEditScript(PIXOEDITOR_PARAM_BATCH) . pixoeditor__printBatchEditScript(PIXOEDITOR_PARAM_MULTI) . "
     150   </script>";
     151}
     152
     153function pixoeditor__printBatchEditScript($param) {
     154   if (!isset($_GET[ $param ]) || !$_GET[ $param ]) {
     155      return '';
     156   }
     157
     158   $args = json_encode(array_map('pixoeditor__resolveImageSrc', explode(',', $_GET[$param])));
     159   $method = $param === PIXOEDITOR_PARAM_BATCH ? 'batchEdit' : 'editMultiple';
     160
     161   return "
     162         Pixo.$method( $args, function () {
     163            const params = Pixo.getSearchParams();
     164            delete params[ '$param' ];
    158165            location.search = Pixo.buildSearchParams( params );
    159166         });
    160       }
    161       if (multi_queue) {
    162          Pixo.editMultiple( JSON.parse( decodeURIComponent( multi_queue ) ), function () {
    163             delete params[ Pixo.PARAM_MULTI ];
    164             location.search = Pixo.buildSearchParams( params );
    165          });
    166       }
    167       })();
    168    </script>";
     167   ";
    169168}
    170169
     
    209208      return add_query_arg(
    210209         PIXOEDITOR_PARAM_BATCH,
    211          rawurlencode( json_encode( array_map( 'pixoeditor__resolveImageSrc', $post_ids ) ) ),
     210         implode( ',', $post_ids ),
    212211         $redirect_to
    213212      );
     
    216215      return add_query_arg(
    217216         PIXOEDITOR_PARAM_MULTI,
    218          rawurlencode( json_encode( array_map( 'pixoeditor__resolveImageSrc', $post_ids ) ) ),
     217         implode( ',', $post_ids ),
    219218         $redirect_to
    220219      );
     
    422421
    423422         <?php
    424          $active_tab = $_GET[ PIXOEDITOR_QUERY_VAR_TAB ] ? $_GET[ PIXOEDITOR_QUERY_VAR_TAB ] : PIXOEDITOR_TAB_ADMIN;
     423         $active_tab = isset( $_GET[ PIXOEDITOR_QUERY_VAR_TAB ] ) ? $_GET[ PIXOEDITOR_QUERY_VAR_TAB ] : PIXOEDITOR_TAB_ADMIN;
    425424         ?>
    426425
  • image-editor-by-pixo/trunk/readme.txt

    r3086913 r3113637  
    55Requires at least: 3.5
    66Tested up to: 6.5
    7 Stable tag: 2.3.2
     7Stable tag: 2.3.3
    88Requires PHP: 5.2
    99License: GPLv2 or later
     
    104104
    105105== Changelog ==
     106= 2.3.3 =
     107* Fixed inability to batch/multiple edit more than ~20 media files
     108
    106109= 2.3.2 =
    107110* Fixed issue when editing older (uploaded long time ago) files
Note: See TracChangeset for help on using the changeset viewer.