Plugin Directory

Changeset 2466937


Ignore:
Timestamp:
02/02/2021 07:10:52 AM (5 years ago)
Author:
plugincraft
Message:

readme.txt

Location:
mediamatic/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • mediamatic/trunk/assets/js/filter.js

    r2465969 r2466937  
    2727                if(settings.data != undefined && settings.data != "" && settings.data.indexOf("action=query-attachments") != -1) {
    2828                    self.dragAndDropMedia();
     29                   
    2930                }
    3031            });
     
    4142                textDrag    = self.moveOneFile;
    4243           
    43             //console.log($('.attachments li').length);
     44           
    4445           
    4546           
     
    8990           
    9091           
    91             $("li.category_item").droppable({
    92                 accept: ".attachments-browser li.attachment",
    93                 hoverClass: 'hover',
    94                 classes: {
    95                     "ui-droppable-active": "ui-state-highlight"
    96                 },
    97                 drop: function() {
    98                    
    99                    
    100                    
    101                     var folderID    = $(this).attr('data-id');
    102                     var IDs         = self.getSelectedFiles();
    103 
    104                     //console.log(IDs);
    105 
    106                     if(IDs.length){
    107                         self.moveMultipleMedia(IDs, folderID);
    108                     }else{
    109                         self.moveSingleMedia(folderID);
     92            setTimeout(function(){
     93                $("li.category_item").droppable({
     94                    accept: ".attachments-browser li.attachment",
     95                    hoverClass: 'hover',
     96                    classes: {
     97                        "ui-droppable-active": "ui-state-highlight"
     98                    },
     99                    drop: function() {
     100
     101                        var folderID    = $(this).attr('data-id');
     102                        var IDs         = self.getSelectedFiles();
     103
     104                        //console.log(IDs);
     105
     106                        if(IDs.length){
     107                            self.moveMultipleMedia(IDs, folderID);
     108                        }else{
     109                            self.moveSingleMedia(folderID);
     110                        }
     111
    110112                    }
    111                    
    112                 }
    113             });
     113                });
     114            }, 100);
    114115           
    115116           
     
    150151                    var fnQueriedObj    = $.parseJSON(data),
    151152                        result          = fnQueriedObj.result;
    152                    
    153                    
    154153                   
    155154                    result.forEach(function(item){
  • mediamatic/trunk/inc/category.php

    r2465969 r2466937  
    6969    public function mediamaticQueryAttachmentsArgs( $query = array() )
    7070    {
    71         $taxquery           = isset( $_REQUEST['query'] ) ? (array) $_REQUEST['query'] : array();
     71        $taxquery           = array();
    7272        $taxonomies         = get_object_taxonomies( 'attachment', 'names' );
    7373        $taxquery           = array_intersect_key( $taxquery, array_flip( $taxonomies ) );
  • mediamatic/trunk/inc/sidebar.php

    r2465969 r2466937  
    401401   
    402402   
     403    public function recursive_sanitize_text_field($array_or_string) {
     404        if( is_string($array_or_string) ){
     405            $array_or_string = sanitize_text_field($array_or_string);
     406        }elseif( is_array($array_or_string) ){
     407            foreach ( $array_or_string as $key => &$value ) {
     408                if ( is_array( $value ) ) {
     409                    $value = recursive_sanitize_text_field($value);
     410                }
     411                else {
     412                    $value = sanitize_text_field( $value );
     413                }
     414            }
     415        }
     416
     417        return $array_or_string;
     418    }
     419   
     420   
    403421    public function mediamaticAjaxMoveMultipleMedia()
    404422    {
    405         $IDs        = $_POST['IDs'];
     423        $IDs        = $this->recursive_sanitize_text_field($_POST['IDs']);
    406424        $folderID   = sanitize_text_field($_POST['folderID']);
    407425        $result     = array();
     
    609627    }
    610628   
    611 
    612     public function mediamaticAjaxSaveMultiAttachments()
    613     {
    614         $ids            = $_REQUEST['ids'];
    615         $result         = array();
    616 
    617         foreach ($ids as $key => $id){
    618             $termList   = wp_get_post_terms( sanitize_text_field($id), MEDIAMATIC_FOLDER, array( 'fields' => 'ids' ) );
    619             $from       = -1;
    620 
    621             if(count($termList)){
    622                 $from   = $termList[0];
    623             }
    624 
    625             $obj        = (object) array('id' => $id, 'from' => $from, 'to' => sanitize_text_field($_REQUEST['folder_id']));
    626             $result[]   = $obj;
    627 
    628             wp_set_object_terms( $id, intval(sanitize_text_field($_REQUEST['folder_id'])), MEDIAMATIC_FOLDER, false );
    629 
    630         }
    631 
    632         wp_send_json_success($result);
    633 
    634     }
    635629   
    636630    public function mediamaticPostsClauses($clauses, $query)
  • mediamatic/trunk/readme.txt

    r2465964 r2466937  
    1 === WordPress Media Library Folders | Mediamatic ===
     1=== Mediamatic - Media Library Folders ===
    22Plugin Name: Mediamatic Lite
    33Plugin URI: https://mediamatic.frenify.com/1/
Note: See TracChangeset for help on using the changeset viewer.