Plugin Directory

Changeset 2786524


Ignore:
Timestamp:
09/18/2022 09:54:06 AM (4 years ago)
Author:
lruizcode
Message:

Update to version 1.0.2 from GitHub

Location:
bubuku-media-library
Files:
24 edited
1 copied

Legend:

Unmodified
Added
Removed
  • bubuku-media-library/assets/icon.svg

    r2782825 r2786524  
    33<rect width="256" height="256" fill="white"/>
    44<path fill-rule="evenodd" clip-rule="evenodd" d="M0 0H255.822V91.1304L256 162.087L255.822 256H0L0 0Z" fill="url(#paint0_linear_103_168)"/>
     5<g filter="url(#filter0_d_103_168)">
     6<path d="M378 -6H-195.894L-197 -2.5974L-195.894 256H310.505L378 -6Z" fill="url(#paint1_linear_103_168)"/>
     7</g>
    58<path d="M60.6172 233.181C60.6172 232.975 63.166 217.432 66.3008 198.675C71.8379 165.143 71.9551 164.494 73.0098 162.371C75.1191 158.094 79.6309 154.821 84.3477 154.201C87.3066 153.818 168.693 153.818 171.652 154.201C176.369 154.821 180.881 158.094 182.99 162.371C184.045 164.494 184.162 165.143 189.699 198.675C192.834 217.432 195.383 232.975 195.383 233.181C195.383 233.447 181.701 233.535 128 233.535C74.2988 233.535 60.6172 233.447 60.6172 233.181ZM130.402 220.854C144.055 219.261 154.924 207.376 155.012 193.868C155.1 182.897 147.629 172.25 137.053 168.269C129.582 165.438 121.818 166.116 114.963 170.186C106.994 174.905 102.219 182.189 101.047 191.42C100.402 196.729 102.219 203.542 105.734 208.791C107.287 211.121 110.627 214.454 112.941 216.046C116.604 218.553 121.232 220.352 125.188 220.824C126.33 220.971 127.414 221.089 127.561 221.119C127.736 221.119 128.996 221.001 130.402 220.854Z" fill="#766964"/>
    69<path d="M77.0234 135.739C74.6211 135.238 70.373 133.114 68.1758 131.345C66.1836 129.723 63.8691 126.744 62.6387 124.208C61.1445 121.081 60.6172 118.368 60.6172 113.738V109.668H128H195.383V113.738C195.383 119.961 194.27 123.588 190.959 128.012C189.084 130.548 186.828 132.347 183.518 134.029C178.859 136.358 182.639 136.211 127.854 136.181C87.2188 136.181 78.6055 136.093 77.0234 135.739ZM99.9043 118.811C100.578 118.427 100.607 117.985 99.9629 117.277C99.5234 116.776 98.791 116.746 89.0352 116.746C78.9863 116.746 78.5176 116.776 77.873 117.336L77.1699 117.926L77.873 118.516C78.5176 119.076 78.9863 119.105 88.9473 119.105C95.5391 119.105 99.5234 118.987 99.9043 118.811ZM115.139 118.516L115.842 117.926L115.139 117.336C114.553 116.835 114.025 116.746 111.594 116.746C109.162 116.746 108.635 116.835 108.049 117.336L107.346 117.926L108.049 118.516C108.635 119.017 109.162 119.105 111.594 119.105C114.025 119.105 114.553 119.017 115.139 118.516Z" fill="#766964"/>
     
    1922<path d="M144.033 98.9569C144.033 98.2391 144.076 98.1956 144.79 98.1956C145.202 98.1956 145.548 98.2391 145.548 98.2826C145.548 98.4131 144.249 99.7183 144.119 99.7183C144.076 99.7183 144.033 99.3702 144.033 98.9569Z" fill="#ABD641"/>
    2023<path d="M89.1532 98.1956C88.9151 98.1086 88.4821 97.7606 88.179 97.4343L87.6378 96.8469L87.5729 89.9731L87.5079 83.0776L93.3098 77.2696L99.1116 71.4399L106.147 78.5095L113.183 85.5791L106.797 91.9961L100.411 98.4131L94.9984 98.3914C92.0325 98.3914 89.3913 98.3044 89.1532 98.1956Z" fill="#ABD641"/>
    21 <path d="M127.363 76.1168C139.573 63.8483 149.683 53.8204 149.835 53.8204C151.004 53.8204 149.878 55.0168 128.532 76.4648C107.879 97.2167 106.645 98.4131 105.931 98.4131C105.195 98.4131 106.083 97.4995 127.363 76.1168Z" fill="#ABD641"/>
     24<path d="M127.363 76.1167C139.573 63.8483 149.683 53.8204 149.835 53.8204C151.004 53.8204 149.878 55.0168 128.532 76.4648C107.879 97.2167 106.645 98.4131 105.931 98.4131C105.195 98.4131 106.083 97.4995 127.363 76.1167Z" fill="#ABD641"/>
    2225<path d="M168.279 97.543C168.279 96.9557 168.344 96.8904 168.929 96.8904C169.513 96.8904 169.557 96.934 169.34 97.3037C169.188 97.5213 168.907 97.8041 168.691 97.9563C168.323 98.1739 168.279 98.1303 168.279 97.543Z" fill="#ABD641"/>
    2326<path d="M168.929 73.6805C168.929 72.9191 168.929 72.8974 169.362 73.2889C169.6 73.5064 169.795 73.8545 169.795 74.0938C169.795 74.333 169.643 74.4853 169.362 74.4853C169.015 74.4853 168.929 74.333 168.929 73.6805Z" fill="#ABD641"/>
     
    3740</g>
    3841<defs>
     42<filter id="filter0_d_103_168" x="-201" y="-6" width="583" height="270" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
     43<feFlood flood-opacity="0" result="BackgroundImageFix"/>
     44<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
     45<feOffset dy="4"/>
     46<feGaussianBlur stdDeviation="2"/>
     47<feComposite in2="hardAlpha" operator="out"/>
     48<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/>
     49<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_103_168"/>
     50<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_103_168" result="shape"/>
     51</filter>
    3952<linearGradient id="paint0_linear_103_168" x1="162.095" y1="405.824" x2="475.362" y2="95.325" gradientUnits="userSpaceOnUse">
    4053<stop stop-color="#FEC754"/>
     
    4659<stop offset="1" stop-color="#FEC754"/>
    4760</linearGradient>
     61<linearGradient id="paint1_linear_103_168" x1="167.081" y1="409.336" x2="410.439" y2="-120.032" gradientUnits="userSpaceOnUse">
     62<stop stop-color="#14B4B7"/>
     63<stop offset="0.278014" stop-color="#81C0CA"/>
     64<stop offset="0.475432" stop-color="#7BBAC4"/>
     65<stop offset="0.596493" stop-color="#93C9D1"/>
     66<stop offset="0.82488" stop-color="#B0D8DE"/>
     67<stop offset="1" stop-color="#0061FF"/>
     68<stop offset="1" stop-color="#14B4B7"/>
     69</linearGradient>
    4870<clipPath id="clip0_103_168">
    4971<rect width="256" height="256" fill="white"/>
  • bubuku-media-library/tags/1.0.2/assets/css/admin.css

    r2783009 r2786524  
    33    --bkml-color-medium: #f6b52c;
    44    --bkml-color-high: #FC4D0D;
    5     --bkml-bg-btn: #B0D8DE;
     5    --bkml-bg-btn-light: #a8cdec;
     6    --bkml-bg-btn: #2271b1;
    67}
    78
     
    4748
    4849.bk_file_size .bk_btn .bk_txt{
    49     display: block;
    5050    width: 100%;
    51     height: 30px;
    52     line-height: 30px;
    53     border-radius: 3px;
    54     background: var(--bkml-bg-btn);
    55     text-align: center;
    56     cursor: pointer;
    5751}
    5852
     
    9185    height: 4px;
    9286    position: relative;
    93     background: var(--bkml-bg-btn);
     87    background: var(--bkml-bg-btn-light);
    9488    overflow: hidden;
    9589    display: none;
     
    10599    width: 10px;
    106100    height: 4px;
    107     background: var(--bkml-color-good);
     101    background: var(--bkml-bg-btn);
    108102    position: absolute;
    109103    top: 0;
  • bubuku-media-library/tags/1.0.2/bubuku-media-library.php

    r2783009 r2786524  
    55 * Requires at least: 5.2
    66 * Requires PHP:      7.2
    7  * Version:     1.0.1
     7 * Version:     1.0.2
    88 * Author:      Bubuku
    99 * Author URI:  https://www.bubuku.com/
  • bubuku-media-library/tags/1.0.2/readme.txt

    r2783009 r2786524  
    55Tested up to: 6.0.2
    66Requires PHP: 7.3
    7 Stable tag: 1.0.0
     7Stable tag: 1.0.2
    88License: GPLv3 or later
    99License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    3232
    3333== Changelog ==
     34= 1.0.2 =
     35* Rename variables
     36* Correctly filter by file size
     37* Styling WordPress Button
    3438
    3539= 1.0.1 =
  • bubuku-media-library/tags/1.0.2/src/BML_assets.php

    r2783009 r2786524  
    11<?php
    2 /**
    3  * Assets Class.
    4  *
    5  * @package Bubuku Media Library
    6  * @author     Luis Ruiz <lruiz@bubuku.com>
    7  * @copyright  2022 Bubuku
    8  * @version    1.0.1
    9  */
    102
    113namespace Bubuku\Plugins\MediaLibrary;
     
    3628        wp_enqueue_style(
    3729            'bk-media-library-css',
    38             BBK_PLUGIN_ASSETS_URL . '/css/admin.css',
     30            BUBUKU_BML_PLUGIN_ASSETS_URL . '/css/admin.css',
    3931            false,
    40             '1.0.1'
     32            '1.0.2'
    4133        );
    4234
     
    4537        wp_enqueue_script(
    4638            'bk-media-library-js',
    47             BBK_PLUGIN_ASSETS_URL . '/js/common.js',
     39            BUBUKU_BML_PLUGIN_ASSETS_URL . '/js/common.js',
    4840            $js_dependencies,
    4941            true
     
    5143
    5244        $args = array(
    53             'nonce'         => BBK_PLUGIN_NONCE,
    54             'api_public'    => '/wp-json/'. BBK_PLUGIN_ENDPOINTS_URL,
     45            'nonce'         => BUBUKU_BML_PLUGIN_NONCE,
     46            'api_public'    => '/wp-json/'. BUBUKU_BML_PLUGIN_ENDPOINTS_URL,
    5547        );
    5648       
  • bubuku-media-library/tags/1.0.2/src/BML_common.php

    r2783009 r2786524  
    11<?php
    2 /**
    3  * Common Class.
    4  *
    5  * @package Bubuku Media Library
    6  * @author     Luis Ruiz <lruiz@bubuku.com>
    7  * @copyright  2022 Bubuku
    8  * @version    1.0.1
    9  */
    102
    113namespace Bubuku\Plugins\MediaLibrary;
     
    7971   
    8072        if ( 'bk_file_size' == $orderby ) {
    81    
    82             $meta_query = array(
    83                 'relation' => 'OR',
    84                 array(
    85                     'key' => '_bkml_attachment_file_size',
    86                     'compare' => 'NOT EXISTS',
    87                 ),
    88                 array(
    89                     'key' => '_bkml_attachment_file_size',
    90                 ),
    91             );
    92    
    93             $query->set( 'meta_query', $meta_query );
    9473            $query->set( 'orderby', 'meta_value_num' );
     74            $query->set( 'meta_key' , '_bkml_attachment_file_size' );
     75            $query->set( 'meta_type' , 'numeric' );
    9576        }
    9677    }
  • bubuku-media-library/tags/1.0.2/src/BML_db.php

    r2783009 r2786524  
    11<?php
    2 /**
    3  * Db Class.
    4  *
    5  * @package Bubuku Media Library
    6  * @author     Luis Ruiz <lruiz@bubuku.com>
    7  * @copyright  2022 Bubuku
    8  * @version    1.0.1
    9  */
    102
    113namespace Bubuku\Plugins\MediaLibrary;
  • bubuku-media-library/tags/1.0.2/src/BML_filter.php

    r2783009 r2786524  
    11<?php
    2 /**
    3  * Filter Class.
    4  *
    5  * @package Bubuku Media Library
    6  * @author     Luis Ruiz <lruiz@bubuku.com>
    7  * @copyright  2022 Bubuku
    8  * @version    1.0.1
    9  */
    102
    113namespace Bubuku\Plugins\MediaLibrary;
     
    2315        // Filter query
    2416        add_action( 'pre_get_posts', [ $this, 'filter_results' ] );
     17        add_action( 'load-upload.php', [ $this, 'notice' ] );
    2518    }
    2619
     
    193186        }
    194187    }
     188
     189    public function notice() {
     190        global $wp_query;
     191        //$count = $custom_posts->found_posts;
     192        // media_list_table_query
     193        // WP_Media_List_Table::no_items()
     194        // has_items
     195        // total_items
     196        // get_pagenum
     197        // $wp_list_table->_pagination_args;
     198        // $wp_list_table->_pagination_args['total_items'];
     199
     200        if(!class_exists('WP_List_Table')){
     201            require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' );
     202        }       
     203
     204        // echo '-+-';
     205        // var_dump($wp_query);
     206
     207        $wp_list_table = _get_list_table('WP_Media_List_Table');
     208        //$data = $wp_list_table->display();
     209        //usort( $data, array( &$this, 'sort_data' ) );
     210        //$totalItems = count($data);
     211        // echo '-+-'. $data;
     212        //var_dump($data);
     213
     214        //$WP_Media_List_Table = new WP_Media_List_Table();
     215        //echo '-*-'. $WP_Media_List_Table->has_items();
     216
     217        //exit();
     218    }
    195219}
  • bubuku-media-library/tags/1.0.2/src/BML_plugin.php

    r2783009 r2786524  
    11<?php
    2 /**
    3  * Plugin Class.
    4  *
    5  * @package Bubuku Media Library
    6  * @author     Luis Ruiz <lruiz@bubuku.com>
    7  * @copyright  2022 Bubuku
    8  * @version    1.0.1
    9  */
    102
    113namespace Bubuku\Plugins\MediaLibrary;
     
    2618     */
    2719    public function init() {
    28         define( 'BBK_PLUGIN_PATH', untrailingslashit( plugin_dir_path( __DIR__ ) ) );
    29         define( 'BBK_PLUGIN_URL', untrailingslashit( plugin_dir_url( __DIR__ ) ) );
    30         define( 'BBK_PLUGIN_BASE', untrailingslashit( plugin_dir_url( __FILE__ ) ) );
    31         define( 'BBK_PLUGIN_ASSETS_PATH', BBK_PLUGIN_PATH . '/assets' );
    32         define( 'BBK_PLUGIN_ASSETS_URL', BBK_PLUGIN_URL . '/assets' );
    33         define( 'BBK_PLUGIN_ENDPOINTS_URL', 'bbk_medialibrary/v1' );
    34         define( 'BBK_PLUGIN_VERSION', '1.0.1' );
    35         define( 'BBK_PLUGIN_NONCE', wp_create_nonce('media-library'. BBK_PLUGIN_VERSION) );
     20        define( 'BUBUKU_BML_PLUGIN_PATH', untrailingslashit( plugin_dir_path( __DIR__ ) ) );
     21        define( 'BUBUKU_BML_PLUGIN_URL', untrailingslashit( plugin_dir_url( __DIR__ ) ) );
     22        define( 'BUBUKU_BML_PLUGIN_BASE', untrailingslashit( plugin_dir_url( __FILE__ ) ) );
     23        define( 'BUBUKU_BML_PLUGIN_ASSETS_PATH', BUBUKU_BML_PLUGIN_PATH . '/assets' );
     24        define( 'BUBUKU_BML_PLUGIN_ASSETS_URL', BUBUKU_BML_PLUGIN_URL . '/assets' );
     25        define( 'BUBUKU_BML_PLUGIN_ENDPOINTS_URL', 'bbk_medialibrary/v1' );
     26        define( 'BUBUKU_BML_PLUGIN_VERSION', '1.0.2' );
     27        define( 'BUBUKU_BML_PLUGIN_NONCE', wp_create_nonce('media-library'. BUBUKU_BML_PLUGIN_VERSION) );
    3628
    37         load_plugin_textdomain( 'bbkmedialibrary', false, BBK_PLUGIN_BASE . '/languages' );
     29        load_plugin_textdomain( 'bbkmedialibrary', false, BUBUKU_BML_PLUGIN_BASE . '/languages' );
    3830
    3931        new BML_assets();
  • bubuku-media-library/tags/1.0.2/src/BML_restapi.php

    r2783009 r2786524  
    11<?php
    2 /**
    3  * Restapi Class.
    4  *
    5  * @package Bubuku Bubuku Media Library
    6  * @author     Luis Ruiz <lruiz@bubuku.com>
    7  * @copyright  2022 Bubuku
    8  * @version    1.0.1
    9  */
    102
    113namespace Bubuku\Plugins\MediaLibrary;
     
    2416
    2517    private function init() {
    26         $this->_namespace = BBK_PLUGIN_ENDPOINTS_URL;
     18        $this->_namespace = BUBUKU_BML_PLUGIN_ENDPOINTS_URL;
    2719        $this->_db = new BML_db();
    2820        $this->_view = new BML_view();
     
    5749        $nonce = $request['_wpnonce'];
    5850
    59         if ( BBK_PLUGIN_NONCE !== $nonce && empty($media_id)) {
     51        if ( BUBUKU_BML_PLUGIN_NONCE !== $nonce && empty($media_id)) {
    6052            wp_send_json_error( esc_html__('empty Media ID', 'bbkmedialibrary') );
    6153            die();
  • bubuku-media-library/tags/1.0.2/src/BML_view.php

    r2783009 r2786524  
    11<?php
    2 /**
    3  * View Class.
    4  *
    5  * @package Bubuku Media Library
    6  * @author     Luis Ruiz <lruiz@bubuku.com>
    7  * @copyright  2022 Bubuku
    8  * @version    1.0.1
    9  */
    102
    113namespace Bubuku\Plugins\MediaLibrary;
     
    7264                        <small>'. esc_html__('In order to sort or filter by size, you need to calculate', 'bbkmedialibrary') .'</small> 
    7365                        <button type="button" class="bk_btn js-calculate" data-id="'. $media_id .'">
    74                             <span class="bk_txt">'. esc_html__('Calculate', 'bbkmedialibrary') .'</span>
     66                            <span class="bk_txt button-primary">'. esc_html__('Calculate', 'bbkmedialibrary') .'</span>
    7567                            <span class="bk_loader"></span>
    7668                        </button>
  • bubuku-media-library/trunk/assets/css/admin.css

    r2783009 r2786524  
    33    --bkml-color-medium: #f6b52c;
    44    --bkml-color-high: #FC4D0D;
    5     --bkml-bg-btn: #B0D8DE;
     5    --bkml-bg-btn-light: #a8cdec;
     6    --bkml-bg-btn: #2271b1;
    67}
    78
     
    4748
    4849.bk_file_size .bk_btn .bk_txt{
    49     display: block;
    5050    width: 100%;
    51     height: 30px;
    52     line-height: 30px;
    53     border-radius: 3px;
    54     background: var(--bkml-bg-btn);
    55     text-align: center;
    56     cursor: pointer;
    5751}
    5852
     
    9185    height: 4px;
    9286    position: relative;
    93     background: var(--bkml-bg-btn);
     87    background: var(--bkml-bg-btn-light);
    9488    overflow: hidden;
    9589    display: none;
     
    10599    width: 10px;
    106100    height: 4px;
    107     background: var(--bkml-color-good);
     101    background: var(--bkml-bg-btn);
    108102    position: absolute;
    109103    top: 0;
  • bubuku-media-library/trunk/bubuku-media-library.php

    r2783009 r2786524  
    55 * Requires at least: 5.2
    66 * Requires PHP:      7.2
    7  * Version:     1.0.1
     7 * Version:     1.0.2
    88 * Author:      Bubuku
    99 * Author URI:  https://www.bubuku.com/
  • bubuku-media-library/trunk/readme.txt

    r2783009 r2786524  
    55Tested up to: 6.0.2
    66Requires PHP: 7.3
    7 Stable tag: 1.0.0
     7Stable tag: 1.0.2
    88License: GPLv3 or later
    99License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    3232
    3333== Changelog ==
     34= 1.0.2 =
     35* Rename variables
     36* Correctly filter by file size
     37* Styling WordPress Button
    3438
    3539= 1.0.1 =
  • bubuku-media-library/trunk/src/BML_assets.php

    r2783009 r2786524  
    11<?php
    2 /**
    3  * Assets Class.
    4  *
    5  * @package Bubuku Media Library
    6  * @author     Luis Ruiz <lruiz@bubuku.com>
    7  * @copyright  2022 Bubuku
    8  * @version    1.0.1
    9  */
    102
    113namespace Bubuku\Plugins\MediaLibrary;
     
    3628        wp_enqueue_style(
    3729            'bk-media-library-css',
    38             BBK_PLUGIN_ASSETS_URL . '/css/admin.css',
     30            BUBUKU_BML_PLUGIN_ASSETS_URL . '/css/admin.css',
    3931            false,
    40             '1.0.1'
     32            '1.0.2'
    4133        );
    4234
     
    4537        wp_enqueue_script(
    4638            'bk-media-library-js',
    47             BBK_PLUGIN_ASSETS_URL . '/js/common.js',
     39            BUBUKU_BML_PLUGIN_ASSETS_URL . '/js/common.js',
    4840            $js_dependencies,
    4941            true
     
    5143
    5244        $args = array(
    53             'nonce'         => BBK_PLUGIN_NONCE,
    54             'api_public'    => '/wp-json/'. BBK_PLUGIN_ENDPOINTS_URL,
     45            'nonce'         => BUBUKU_BML_PLUGIN_NONCE,
     46            'api_public'    => '/wp-json/'. BUBUKU_BML_PLUGIN_ENDPOINTS_URL,
    5547        );
    5648       
  • bubuku-media-library/trunk/src/BML_common.php

    r2783009 r2786524  
    11<?php
    2 /**
    3  * Common Class.
    4  *
    5  * @package Bubuku Media Library
    6  * @author     Luis Ruiz <lruiz@bubuku.com>
    7  * @copyright  2022 Bubuku
    8  * @version    1.0.1
    9  */
    102
    113namespace Bubuku\Plugins\MediaLibrary;
     
    7971   
    8072        if ( 'bk_file_size' == $orderby ) {
    81    
    82             $meta_query = array(
    83                 'relation' => 'OR',
    84                 array(
    85                     'key' => '_bkml_attachment_file_size',
    86                     'compare' => 'NOT EXISTS',
    87                 ),
    88                 array(
    89                     'key' => '_bkml_attachment_file_size',
    90                 ),
    91             );
    92    
    93             $query->set( 'meta_query', $meta_query );
    9473            $query->set( 'orderby', 'meta_value_num' );
     74            $query->set( 'meta_key' , '_bkml_attachment_file_size' );
     75            $query->set( 'meta_type' , 'numeric' );
    9576        }
    9677    }
  • bubuku-media-library/trunk/src/BML_db.php

    r2783009 r2786524  
    11<?php
    2 /**
    3  * Db Class.
    4  *
    5  * @package Bubuku Media Library
    6  * @author     Luis Ruiz <lruiz@bubuku.com>
    7  * @copyright  2022 Bubuku
    8  * @version    1.0.1
    9  */
    102
    113namespace Bubuku\Plugins\MediaLibrary;
  • bubuku-media-library/trunk/src/BML_filter.php

    r2783009 r2786524  
    11<?php
    2 /**
    3  * Filter Class.
    4  *
    5  * @package Bubuku Media Library
    6  * @author     Luis Ruiz <lruiz@bubuku.com>
    7  * @copyright  2022 Bubuku
    8  * @version    1.0.1
    9  */
    102
    113namespace Bubuku\Plugins\MediaLibrary;
     
    2315        // Filter query
    2416        add_action( 'pre_get_posts', [ $this, 'filter_results' ] );
     17        add_action( 'load-upload.php', [ $this, 'notice' ] );
    2518    }
    2619
     
    193186        }
    194187    }
     188
     189    public function notice() {
     190        global $wp_query;
     191        //$count = $custom_posts->found_posts;
     192        // media_list_table_query
     193        // WP_Media_List_Table::no_items()
     194        // has_items
     195        // total_items
     196        // get_pagenum
     197        // $wp_list_table->_pagination_args;
     198        // $wp_list_table->_pagination_args['total_items'];
     199
     200        if(!class_exists('WP_List_Table')){
     201            require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' );
     202        }       
     203
     204        // echo '-+-';
     205        // var_dump($wp_query);
     206
     207        $wp_list_table = _get_list_table('WP_Media_List_Table');
     208        //$data = $wp_list_table->display();
     209        //usort( $data, array( &$this, 'sort_data' ) );
     210        //$totalItems = count($data);
     211        // echo '-+-'. $data;
     212        //var_dump($data);
     213
     214        //$WP_Media_List_Table = new WP_Media_List_Table();
     215        //echo '-*-'. $WP_Media_List_Table->has_items();
     216
     217        //exit();
     218    }
    195219}
  • bubuku-media-library/trunk/src/BML_plugin.php

    r2783009 r2786524  
    11<?php
    2 /**
    3  * Plugin Class.
    4  *
    5  * @package Bubuku Media Library
    6  * @author     Luis Ruiz <lruiz@bubuku.com>
    7  * @copyright  2022 Bubuku
    8  * @version    1.0.1
    9  */
    102
    113namespace Bubuku\Plugins\MediaLibrary;
     
    2618     */
    2719    public function init() {
    28         define( 'BBK_PLUGIN_PATH', untrailingslashit( plugin_dir_path( __DIR__ ) ) );
    29         define( 'BBK_PLUGIN_URL', untrailingslashit( plugin_dir_url( __DIR__ ) ) );
    30         define( 'BBK_PLUGIN_BASE', untrailingslashit( plugin_dir_url( __FILE__ ) ) );
    31         define( 'BBK_PLUGIN_ASSETS_PATH', BBK_PLUGIN_PATH . '/assets' );
    32         define( 'BBK_PLUGIN_ASSETS_URL', BBK_PLUGIN_URL . '/assets' );
    33         define( 'BBK_PLUGIN_ENDPOINTS_URL', 'bbk_medialibrary/v1' );
    34         define( 'BBK_PLUGIN_VERSION', '1.0.1' );
    35         define( 'BBK_PLUGIN_NONCE', wp_create_nonce('media-library'. BBK_PLUGIN_VERSION) );
     20        define( 'BUBUKU_BML_PLUGIN_PATH', untrailingslashit( plugin_dir_path( __DIR__ ) ) );
     21        define( 'BUBUKU_BML_PLUGIN_URL', untrailingslashit( plugin_dir_url( __DIR__ ) ) );
     22        define( 'BUBUKU_BML_PLUGIN_BASE', untrailingslashit( plugin_dir_url( __FILE__ ) ) );
     23        define( 'BUBUKU_BML_PLUGIN_ASSETS_PATH', BUBUKU_BML_PLUGIN_PATH . '/assets' );
     24        define( 'BUBUKU_BML_PLUGIN_ASSETS_URL', BUBUKU_BML_PLUGIN_URL . '/assets' );
     25        define( 'BUBUKU_BML_PLUGIN_ENDPOINTS_URL', 'bbk_medialibrary/v1' );
     26        define( 'BUBUKU_BML_PLUGIN_VERSION', '1.0.2' );
     27        define( 'BUBUKU_BML_PLUGIN_NONCE', wp_create_nonce('media-library'. BUBUKU_BML_PLUGIN_VERSION) );
    3628
    37         load_plugin_textdomain( 'bbkmedialibrary', false, BBK_PLUGIN_BASE . '/languages' );
     29        load_plugin_textdomain( 'bbkmedialibrary', false, BUBUKU_BML_PLUGIN_BASE . '/languages' );
    3830
    3931        new BML_assets();
  • bubuku-media-library/trunk/src/BML_restapi.php

    r2783009 r2786524  
    11<?php
    2 /**
    3  * Restapi Class.
    4  *
    5  * @package Bubuku Bubuku Media Library
    6  * @author     Luis Ruiz <lruiz@bubuku.com>
    7  * @copyright  2022 Bubuku
    8  * @version    1.0.1
    9  */
    102
    113namespace Bubuku\Plugins\MediaLibrary;
     
    2416
    2517    private function init() {
    26         $this->_namespace = BBK_PLUGIN_ENDPOINTS_URL;
     18        $this->_namespace = BUBUKU_BML_PLUGIN_ENDPOINTS_URL;
    2719        $this->_db = new BML_db();
    2820        $this->_view = new BML_view();
     
    5749        $nonce = $request['_wpnonce'];
    5850
    59         if ( BBK_PLUGIN_NONCE !== $nonce && empty($media_id)) {
     51        if ( BUBUKU_BML_PLUGIN_NONCE !== $nonce && empty($media_id)) {
    6052            wp_send_json_error( esc_html__('empty Media ID', 'bbkmedialibrary') );
    6153            die();
  • bubuku-media-library/trunk/src/BML_view.php

    r2783009 r2786524  
    11<?php
    2 /**
    3  * View Class.
    4  *
    5  * @package Bubuku Media Library
    6  * @author     Luis Ruiz <lruiz@bubuku.com>
    7  * @copyright  2022 Bubuku
    8  * @version    1.0.1
    9  */
    102
    113namespace Bubuku\Plugins\MediaLibrary;
     
    7264                        <small>'. esc_html__('In order to sort or filter by size, you need to calculate', 'bbkmedialibrary') .'</small> 
    7365                        <button type="button" class="bk_btn js-calculate" data-id="'. $media_id .'">
    74                             <span class="bk_txt">'. esc_html__('Calculate', 'bbkmedialibrary') .'</span>
     66                            <span class="bk_txt button-primary">'. esc_html__('Calculate', 'bbkmedialibrary') .'</span>
    7567                            <span class="bk_loader"></span>
    7668                        </button>
Note: See TracChangeset for help on using the changeset viewer.