Plugin Directory

Changeset 2697405


Ignore:
Timestamp:
03/22/2022 01:30:38 AM (4 years ago)
Author:
communicatti
Message:

version 1.1.21

Location:
pxl-tools
Files:
2 added
20 edited
1 copied

Legend:

Unmodified
Added
Removed
  • pxl-tools/tags/1.1.21/README.md

    r2691584 r2697405  
    6161Return a posts pagination
    6262
    63     $pagination = \Pxl\Post::pagination($args = [], $per_page);
     63    $pagination = \Pxl\Post::pagination($args = [], $per_page = 6, $paginate_args = []);
    6464
    6565- **\$args** see get_posts - https://developer.wordpress.org/reference/functions/get_posts/
     66
     67- **\$args** array $paginate_args https://developer.wordpress.org/reference/functions/paginate_links/
    6668
    6769#### get_posts_keys()
  • pxl-tools/tags/1.1.21/helpers/Post.php

    r2691584 r2697405  
    6262     * Get wordpress paginations links
    6363     *
    64      * @param  mixed $args https://developer.wordpress.org/reference/functions/get_posts/ args
    65      * @param  mixed $per_page results per page
     64     * @param  array $args https://developer.wordpress.org/reference/functions/get_posts/ args
     65     * @param  int $per_page results per page
     66     * @param  array $paginate_args https://developer.wordpress.org/reference/functions/paginate_links/ args
    6667     * @return array
    6768     */
    68     public static function pagination($args = [], $per_page)
     69    public static function pagination($args = [], $per_page = 4, $paginate_args = [])
    6970    {
    7071
    71         $big = 999999999;
    7272        $args['posts_per_page'] = -1;
    7373        unset($args['paged']);
     74
    7475        $query = new \WP_Query($args);
    7576        $published_count = $query->found_posts;
    7677
     78        $big = 999999999;
    7779        $total_posts = ceil($published_count / $per_page);
    7880
    79         $pagination = paginate_links([
     81        $default_paginate_args = [
    8082            'base' => str_replace($big, '%#%', esc_url(get_pagenum_link($big))),
    8183            'format' => '?paged=%#%',
     
    8385            'total' => $total_posts,
    8486            'type' => 'array',
    85             'mid_size' => 0,
    8687            'prev_text' => '<<',
    8788            'next_text' => '>>',
    88         ]);
     89        ];
     90
     91        $paginate_links_args = array_merge($default_paginate_args, $paginate_args);
     92
     93        $pagination = paginate_links($paginate_links_args);
    8994
    9095        return is_array($pagination) ? $pagination : [];
  • pxl-tools/tags/1.1.21/pxl-tools.php

    r2691584 r2697405  
    1010 * License:     GPL-2.0
    1111 * License URI: https://opensource.org/licenses/GPL-2.0
    12  * Version:     1.1.20
     12 * Version:     1.1.21
    1313 *
    1414 *
  • pxl-tools/tags/1.1.21/readme.txt

    r2691584 r2697405  
    77License: https://opensource.org/licenses/GPL-2.0
    88License URI: https://opensource.org/licenses/GPL-2.0
    9 Stable tag: 1.1.20
     9Stable tag: 1.1.21
    1010A Toolbelt for Wordpress development
    1111
     
    1313Helpers, Functions and Shortcuts to Wordpress development
    1414
     15=1.1.21=
     16* Add paginate_links args in \Pxl\Post::pagination
     17* Enable webp upload
    1518
    1619= 1.1.20 =
  • pxl-tools/tags/1.1.21/vendor/autoload.php

    r2691584 r2697405  
    55require_once __DIR__ . '/composer/autoload_real.php';
    66
    7 return ComposerAutoloaderInitcfd64b7794319c2e56256ba8a9836ef5::getLoader();
     7return ComposerAutoloaderInit9f710a513326c38d1f77df8cb4d18344::getLoader();
  • pxl-tools/tags/1.1.21/vendor/composer/InstalledVersions.php

    r2691584 r2697405  
    3131    array (
    3232    ),
    33     'reference' => '6992f77bded268719d72f2bdf6f6fa7ce53fa49e',
     33    'reference' => '89d18178436ab03ef748ee1369cba34fd409485d',
    3434    'name' => 'communicatti/pxl',
    3535  ),
     
    4343      array (
    4444      ),
    45       'reference' => '6992f77bded268719d72f2bdf6f6fa7ce53fa49e',
     45      'reference' => '89d18178436ab03ef748ee1369cba34fd409485d',
    4646    ),
    4747    'doctrine/inflector' =>
  • pxl-tools/tags/1.1.21/vendor/composer/autoload_real.php

    r2691584 r2697405  
    33// autoload_real.php @generated by Composer
    44
    5 class ComposerAutoloaderInitcfd64b7794319c2e56256ba8a9836ef5
     5class ComposerAutoloaderInit9f710a513326c38d1f77df8cb4d18344
    66{
    77    private static $loader;
     
    2525        require __DIR__ . '/platform_check.php';
    2626
    27         spl_autoload_register(array('ComposerAutoloaderInitcfd64b7794319c2e56256ba8a9836ef5', 'loadClassLoader'), true, true);
     27        spl_autoload_register(array('ComposerAutoloaderInit9f710a513326c38d1f77df8cb4d18344', 'loadClassLoader'), true, true);
    2828        self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
    29         spl_autoload_unregister(array('ComposerAutoloaderInitcfd64b7794319c2e56256ba8a9836ef5', 'loadClassLoader'));
     29        spl_autoload_unregister(array('ComposerAutoloaderInit9f710a513326c38d1f77df8cb4d18344', 'loadClassLoader'));
    3030
    3131        $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
     
    3333            require __DIR__ . '/autoload_static.php';
    3434
    35             call_user_func(\Composer\Autoload\ComposerStaticInitcfd64b7794319c2e56256ba8a9836ef5::getInitializer($loader));
     35            call_user_func(\Composer\Autoload\ComposerStaticInit9f710a513326c38d1f77df8cb4d18344::getInitializer($loader));
    3636        } else {
    3737            $map = require __DIR__ . '/autoload_namespaces.php';
     
    5454
    5555        if ($useStaticLoader) {
    56             $includeFiles = Composer\Autoload\ComposerStaticInitcfd64b7794319c2e56256ba8a9836ef5::$files;
     56            $includeFiles = Composer\Autoload\ComposerStaticInit9f710a513326c38d1f77df8cb4d18344::$files;
    5757        } else {
    5858            $includeFiles = require __DIR__ . '/autoload_files.php';
    5959        }
    6060        foreach ($includeFiles as $fileIdentifier => $file) {
    61             composerRequirecfd64b7794319c2e56256ba8a9836ef5($fileIdentifier, $file);
     61            composerRequire9f710a513326c38d1f77df8cb4d18344($fileIdentifier, $file);
    6262        }
    6363
     
    6666}
    6767
    68 function composerRequirecfd64b7794319c2e56256ba8a9836ef5($fileIdentifier, $file)
     68function composerRequire9f710a513326c38d1f77df8cb4d18344($fileIdentifier, $file)
    6969{
    7070    if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
  • pxl-tools/tags/1.1.21/vendor/composer/autoload_static.php

    r2691584 r2697405  
    55namespace Composer\Autoload;
    66
    7 class ComposerStaticInitcfd64b7794319c2e56256ba8a9836ef5
     7class ComposerStaticInit9f710a513326c38d1f77df8cb4d18344
    88{
    99    public static $files = array (
     
    138138    {
    139139        return \Closure::bind(function () use ($loader) {
    140             $loader->prefixLengthsPsr4 = ComposerStaticInitcfd64b7794319c2e56256ba8a9836ef5::$prefixLengthsPsr4;
    141             $loader->prefixDirsPsr4 = ComposerStaticInitcfd64b7794319c2e56256ba8a9836ef5::$prefixDirsPsr4;
    142             $loader->classMap = ComposerStaticInitcfd64b7794319c2e56256ba8a9836ef5::$classMap;
     140            $loader->prefixLengthsPsr4 = ComposerStaticInit9f710a513326c38d1f77df8cb4d18344::$prefixLengthsPsr4;
     141            $loader->prefixDirsPsr4 = ComposerStaticInit9f710a513326c38d1f77df8cb4d18344::$prefixDirsPsr4;
     142            $loader->classMap = ComposerStaticInit9f710a513326c38d1f77df8cb4d18344::$classMap;
    143143
    144144        }, null, ClassLoader::class);
  • pxl-tools/tags/1.1.21/vendor/composer/installed.php

    r2691584 r2697405  
    77    array (
    88    ),
    9     'reference' => '6992f77bded268719d72f2bdf6f6fa7ce53fa49e',
     9    'reference' => '89d18178436ab03ef748ee1369cba34fd409485d',
    1010    'name' => 'communicatti/pxl',
    1111  ),
     
    1919      array (
    2020      ),
    21       'reference' => '6992f77bded268719d72f2bdf6f6fa7ce53fa49e',
     21      'reference' => '89d18178436ab03ef748ee1369cba34fd409485d',
    2222    ),
    2323    'doctrine/inflector' =>
  • pxl-tools/tags/1.1.21/vendor/symfony/polyfill-mbstring/bootstrap.php

    r2691584 r2697405  
    1313
    1414if (!function_exists('mb_convert_encoding')) {
    15     function mb_convert_encoding($string, $to_encoding, $from_encoding = null)
    16     {
    17         return p\Mbstring::mb_convert_encoding($string, $to_encoding, $from_encoding);
    18     }
     15    function mb_convert_encoding($string, $to_encoding, $from_encoding = null) { return p\Mbstring::mb_convert_encoding($string, $to_encoding, $from_encoding); }
    1916}
    2017if (!function_exists('mb_decode_mimeheader')) {
    21     function mb_decode_mimeheader($string)
    22     {
    23         return p\Mbstring::mb_decode_mimeheader($string);
    24     }
     18    function mb_decode_mimeheader($string) { return p\Mbstring::mb_decode_mimeheader($string); }
    2519}
    2620if (!function_exists('mb_encode_mimeheader')) {
    27     function mb_encode_mimeheader($string, $charset = null, $transfer_encoding = null, $newline = "\r\n", $indent = 0)
    28     {
    29         return p\Mbstring::mb_encode_mimeheader($string, $charset, $transfer_encoding, $newline, $indent);
    30     }
     21    function mb_encode_mimeheader($string, $charset = null, $transfer_encoding = null, $newline = "\r\n", $indent = 0) { return p\Mbstring::mb_encode_mimeheader($string, $charset, $transfer_encoding, $newline, $indent); }
    3122}
    3223if (!function_exists('mb_decode_numericentity')) {
    33     function mb_decode_numericentity($string, $map, $encoding = null)
    34     {
    35         return p\Mbstring::mb_decode_numericentity($string, $map, $encoding);
    36     }
     24    function mb_decode_numericentity($string, $map, $encoding = null) { return p\Mbstring::mb_decode_numericentity($string, $map, $encoding); }
    3725}
    3826if (!function_exists('mb_encode_numericentity')) {
    39     function mb_encode_numericentity($string, $map, $encoding = null, $hex = false)
    40     {
    41         return p\Mbstring::mb_encode_numericentity($string, $map, $encoding, $hex);
    42     }
     27    function mb_encode_numericentity($string, $map, $encoding = null, $hex = false) { return p\Mbstring::mb_encode_numericentity($string, $map, $encoding, $hex); }
    4328}
    4429if (!function_exists('mb_convert_case')) {
    45     function mb_convert_case($string, $mode, $encoding = null)
    46     {
    47         return p\Mbstring::mb_convert_case($string, $mode, $encoding);
    48     }
     30    function mb_convert_case($string, $mode, $encoding = null) { return p\Mbstring::mb_convert_case($string, $mode, $encoding); }
    4931}
    5032if (!function_exists('mb_internal_encoding')) {
    51     function mb_internal_encoding($encoding = null)
    52     {
    53         return p\Mbstring::mb_internal_encoding($encoding);
    54     }
     33    function mb_internal_encoding($encoding = null) { return p\Mbstring::mb_internal_encoding($encoding); }
    5534}
    5635if (!function_exists('mb_language')) {
    57     function mb_language($language = null)
    58     {
    59         return p\Mbstring::mb_language($language);
    60     }
     36    function mb_language($language = null) { return p\Mbstring::mb_language($language); }
    6137}
    6238if (!function_exists('mb_list_encodings')) {
    63     function mb_list_encodings()
    64     {
    65         return p\Mbstring::mb_list_encodings();
    66     }
     39    function mb_list_encodings() { return p\Mbstring::mb_list_encodings(); }
    6740}
    6841if (!function_exists('mb_encoding_aliases')) {
    69     function mb_encoding_aliases($encoding)
    70     {
    71         return p\Mbstring::mb_encoding_aliases($encoding);
    72     }
     42    function mb_encoding_aliases($encoding) { return p\Mbstring::mb_encoding_aliases($encoding); }
    7343}
    7444if (!function_exists('mb_check_encoding')) {
    75     function mb_check_encoding($value = null, $encoding = null)
    76     {
    77         return p\Mbstring::mb_check_encoding($value, $encoding);
    78     }
     45    function mb_check_encoding($value = null, $encoding = null) { return p\Mbstring::mb_check_encoding($value, $encoding); }
    7946}
    8047if (!function_exists('mb_detect_encoding')) {
    81     function mb_detect_encoding($string, $encodings = null, $strict = false)
    82     {
    83         return p\Mbstring::mb_detect_encoding($string, $encodings, $strict);
    84     }
     48    function mb_detect_encoding($string, $encodings = null, $strict = false) { return p\Mbstring::mb_detect_encoding($string, $encodings, $strict); }
    8549}
    8650if (!function_exists('mb_detect_order')) {
    87     function mb_detect_order($encoding = null)
    88     {
    89         return p\Mbstring::mb_detect_order($encoding);
    90     }
     51    function mb_detect_order($encoding = null) { return p\Mbstring::mb_detect_order($encoding); }
    9152}
    9253if (!function_exists('mb_parse_str')) {
    93     function mb_parse_str($string, &$result = [])
    94     {
    95         parse_str($string, $result);
    96         return (bool) $result;
    97     }
     54    function mb_parse_str($string, &$result = []) { parse_str($string, $result); return (bool) $result; }
    9855}
    9956if (!function_exists('mb_strlen')) {
    100     function mb_strlen($string, $encoding = null)
    101     {
    102         return p\Mbstring::mb_strlen($string, $encoding);
    103     }
     57    function mb_strlen($string, $encoding = null) { return p\Mbstring::mb_strlen($string, $encoding); }
    10458}
    10559if (!function_exists('mb_strpos')) {
    106     function mb_strpos($haystack, $needle, $offset = 0, $encoding = null)
    107     {
    108         return p\Mbstring::mb_strpos($haystack, $needle, $offset, $encoding);
    109     }
     60    function mb_strpos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strpos($haystack, $needle, $offset, $encoding); }
    11061}
    11162if (!function_exists('mb_strtolower')) {
    112     function mb_strtolower($string, $encoding = null)
    113     {
    114         return p\Mbstring::mb_strtolower($string, $encoding);
    115     }
     63    function mb_strtolower($string, $encoding = null) { return p\Mbstring::mb_strtolower($string, $encoding); }
    11664}
    11765if (!function_exists('mb_strtoupper')) {
    118     function mb_strtoupper($string, $encoding = null)
    119     {
    120         return p\Mbstring::mb_strtoupper($string, $encoding);
    121     }
     66    function mb_strtoupper($string, $encoding = null) { return p\Mbstring::mb_strtoupper($string, $encoding); }
    12267}
    12368if (!function_exists('mb_substitute_character')) {
    124     function mb_substitute_character($substitute_character = null)
    125     {
    126         return p\Mbstring::mb_substitute_character($substitute_character);
    127     }
     69    function mb_substitute_character($substitute_character = null) { return p\Mbstring::mb_substitute_character($substitute_character); }
    12870}
    12971if (!function_exists('mb_substr')) {
    130     function mb_substr($string, $start, $length = 2147483647, $encoding = null)
    131     {
    132         return p\Mbstring::mb_substr($string, $start, $length, $encoding);
    133     }
     72    function mb_substr($string, $start, $length = 2147483647, $encoding = null) { return p\Mbstring::mb_substr($string, $start, $length, $encoding); }
    13473}
    13574if (!function_exists('mb_stripos')) {
    136     function mb_stripos($haystack, $needle, $offset = 0, $encoding = null)
    137     {
    138         return p\Mbstring::mb_stripos($haystack, $needle, $offset, $encoding);
    139     }
     75    function mb_stripos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_stripos($haystack, $needle, $offset, $encoding); }
    14076}
    14177if (!function_exists('mb_stristr')) {
    142     function mb_stristr($haystack, $needle, $before_needle = false, $encoding = null)
    143     {
    144         return p\Mbstring::mb_stristr($haystack, $needle, $before_needle, $encoding);
    145     }
     78    function mb_stristr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_stristr($haystack, $needle, $before_needle, $encoding); }
    14679}
    14780if (!function_exists('mb_strrchr')) {
    148     function mb_strrchr($haystack, $needle, $before_needle = false, $encoding = null)
    149     {
    150         return p\Mbstring::mb_strrchr($haystack, $needle, $before_needle, $encoding);
    151     }
     81    function mb_strrchr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strrchr($haystack, $needle, $before_needle, $encoding); }
    15282}
    15383if (!function_exists('mb_strrichr')) {
    154     function mb_strrichr($haystack, $needle, $before_needle = false, $encoding = null)
    155     {
    156         return p\Mbstring::mb_strrichr($haystack, $needle, $before_needle, $encoding);
    157     }
     84    function mb_strrichr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strrichr($haystack, $needle, $before_needle, $encoding); }
    15885}
    15986if (!function_exists('mb_strripos')) {
    160     function mb_strripos($haystack, $needle, $offset = 0, $encoding = null)
    161     {
    162         return p\Mbstring::mb_strripos($haystack, $needle, $offset, $encoding);
    163     }
     87    function mb_strripos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strripos($haystack, $needle, $offset, $encoding); }
    16488}
    16589if (!function_exists('mb_strrpos')) {
    166     function mb_strrpos($haystack, $needle, $offset = 0, $encoding = null)
    167     {
    168         return p\Mbstring::mb_strrpos($haystack, $needle, $offset, $encoding);
    169     }
     90    function mb_strrpos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strrpos($haystack, $needle, $offset, $encoding); }
    17091}
    17192if (!function_exists('mb_strstr')) {
    172     function mb_strstr($haystack, $needle, $before_needle = false, $encoding = null)
    173     {
    174         return p\Mbstring::mb_strstr($haystack, $needle, $before_needle, $encoding);
    175     }
     93    function mb_strstr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strstr($haystack, $needle, $before_needle, $encoding); }
    17694}
    17795if (!function_exists('mb_get_info')) {
    178     function mb_get_info($type = 'all')
    179     {
    180         return p\Mbstring::mb_get_info($type);
    181     }
     96    function mb_get_info($type = 'all') { return p\Mbstring::mb_get_info($type); }
    18297}
    18398if (!function_exists('mb_http_output')) {
    184     function mb_http_output($encoding = null)
    185     {
    186         return p\Mbstring::mb_http_output($encoding);
    187     }
     99    function mb_http_output($encoding = null) { return p\Mbstring::mb_http_output($encoding); }
    188100}
    189101if (!function_exists('mb_strwidth')) {
    190     function mb_strwidth($string, $encoding = null)
    191     {
    192         return p\Mbstring::mb_strwidth($string, $encoding);
    193     }
     102    function mb_strwidth($string, $encoding = null) { return p\Mbstring::mb_strwidth($string, $encoding); }
    194103}
    195104if (!function_exists('mb_substr_count')) {
    196     function mb_substr_count($haystack, $needle, $encoding = null)
    197     {
    198         return p\Mbstring::mb_substr_count($haystack, $needle, $encoding);
    199     }
     105    function mb_substr_count($haystack, $needle, $encoding = null) { return p\Mbstring::mb_substr_count($haystack, $needle, $encoding); }
    200106}
    201107if (!function_exists('mb_output_handler')) {
    202     function mb_output_handler($string, $status)
    203     {
    204         return p\Mbstring::mb_output_handler($string, $status);
    205     }
     108    function mb_output_handler($string, $status) { return p\Mbstring::mb_output_handler($string, $status); }
    206109}
    207110if (!function_exists('mb_http_input')) {
    208     function mb_http_input($type = null)
    209     {
    210         return p\Mbstring::mb_http_input($type);
    211     }
     111    function mb_http_input($type = null) { return p\Mbstring::mb_http_input($type); }
    212112}
    213113
    214114if (!function_exists('mb_convert_variables')) {
    215     function mb_convert_variables($to_encoding, $from_encoding, &...$vars)
    216     {
    217         return p\Mbstring::mb_convert_variables($to_encoding, $from_encoding, ...$vars);
    218     }
     115    function mb_convert_variables($to_encoding, $from_encoding, &...$vars) { return p\Mbstring::mb_convert_variables($to_encoding, $from_encoding, ...$vars); }
    219116}
    220117
    221118if (!function_exists('mb_ord')) {
    222     function mb_ord($string, $encoding = null)
    223     {
    224         return p\Mbstring::mb_ord($string, $encoding);
    225     }
     119    function mb_ord($string, $encoding = null) { return p\Mbstring::mb_ord($string, $encoding); }
    226120}
    227121if (!function_exists('mb_chr')) {
    228     function mb_chr($codepoint, $encoding = null)
    229     {
    230         return p\Mbstring::mb_chr($codepoint, $encoding);
    231     }
     122    function mb_chr($codepoint, $encoding = null) { return p\Mbstring::mb_chr($codepoint, $encoding); }
    232123}
    233124if (!function_exists('mb_scrub')) {
    234     function mb_scrub($string, $encoding = null)
    235     {
    236         $encoding = null === $encoding ? mb_internal_encoding() : $encoding;
    237         return mb_convert_encoding($string, $encoding, $encoding);
    238     }
     125    function mb_scrub($string, $encoding = null) { $encoding = null === $encoding ? mb_internal_encoding() : $encoding; return mb_convert_encoding($string, $encoding, $encoding); }
    239126}
    240127if (!function_exists('mb_str_split')) {
    241     function mb_str_split($string, $length = 1, $encoding = null)
    242     {
    243         return p\Mbstring::mb_str_split($string, $length, $encoding);
    244     }
     128    function mb_str_split($string, $length = 1, $encoding = null) { return p\Mbstring::mb_str_split($string, $length, $encoding); }
    245129}
    246130
  • pxl-tools/trunk/README.md

    r2691584 r2697405  
    6161Return a posts pagination
    6262
    63     $pagination = \Pxl\Post::pagination($args = [], $per_page);
     63    $pagination = \Pxl\Post::pagination($args = [], $per_page = 6, $paginate_args = []);
    6464
    6565- **\$args** see get_posts - https://developer.wordpress.org/reference/functions/get_posts/
     66
     67- **\$args** array $paginate_args https://developer.wordpress.org/reference/functions/paginate_links/
    6668
    6769#### get_posts_keys()
  • pxl-tools/trunk/helpers/Post.php

    r2691584 r2697405  
    6262     * Get wordpress paginations links
    6363     *
    64      * @param  mixed $args https://developer.wordpress.org/reference/functions/get_posts/ args
    65      * @param  mixed $per_page results per page
     64     * @param  array $args https://developer.wordpress.org/reference/functions/get_posts/ args
     65     * @param  int $per_page results per page
     66     * @param  array $paginate_args https://developer.wordpress.org/reference/functions/paginate_links/ args
    6667     * @return array
    6768     */
    68     public static function pagination($args = [], $per_page)
     69    public static function pagination($args = [], $per_page = 4, $paginate_args = [])
    6970    {
    7071
    71         $big = 999999999;
    7272        $args['posts_per_page'] = -1;
    7373        unset($args['paged']);
     74
    7475        $query = new \WP_Query($args);
    7576        $published_count = $query->found_posts;
    7677
     78        $big = 999999999;
    7779        $total_posts = ceil($published_count / $per_page);
    7880
    79         $pagination = paginate_links([
     81        $default_paginate_args = [
    8082            'base' => str_replace($big, '%#%', esc_url(get_pagenum_link($big))),
    8183            'format' => '?paged=%#%',
     
    8385            'total' => $total_posts,
    8486            'type' => 'array',
    85             'mid_size' => 0,
    8687            'prev_text' => '<<',
    8788            'next_text' => '>>',
    88         ]);
     89        ];
     90
     91        $paginate_links_args = array_merge($default_paginate_args, $paginate_args);
     92
     93        $pagination = paginate_links($paginate_links_args);
    8994
    9095        return is_array($pagination) ? $pagination : [];
  • pxl-tools/trunk/pxl-tools.php

    r2691584 r2697405  
    1010 * License:     GPL-2.0
    1111 * License URI: https://opensource.org/licenses/GPL-2.0
    12  * Version:     1.1.20
     12 * Version:     1.1.21
    1313 *
    1414 *
  • pxl-tools/trunk/readme.txt

    r2691584 r2697405  
    77License: https://opensource.org/licenses/GPL-2.0
    88License URI: https://opensource.org/licenses/GPL-2.0
    9 Stable tag: 1.1.20
     9Stable tag: 1.1.21
    1010A Toolbelt for Wordpress development
    1111
     
    1313Helpers, Functions and Shortcuts to Wordpress development
    1414
     15=1.1.21=
     16* Add paginate_links args in \Pxl\Post::pagination
     17* Enable webp upload
    1518
    1619= 1.1.20 =
  • pxl-tools/trunk/vendor/autoload.php

    r2691584 r2697405  
    55require_once __DIR__ . '/composer/autoload_real.php';
    66
    7 return ComposerAutoloaderInitcfd64b7794319c2e56256ba8a9836ef5::getLoader();
     7return ComposerAutoloaderInit9f710a513326c38d1f77df8cb4d18344::getLoader();
  • pxl-tools/trunk/vendor/composer/InstalledVersions.php

    r2691584 r2697405  
    3131    array (
    3232    ),
    33     'reference' => '6992f77bded268719d72f2bdf6f6fa7ce53fa49e',
     33    'reference' => '89d18178436ab03ef748ee1369cba34fd409485d',
    3434    'name' => 'communicatti/pxl',
    3535  ),
     
    4343      array (
    4444      ),
    45       'reference' => '6992f77bded268719d72f2bdf6f6fa7ce53fa49e',
     45      'reference' => '89d18178436ab03ef748ee1369cba34fd409485d',
    4646    ),
    4747    'doctrine/inflector' =>
  • pxl-tools/trunk/vendor/composer/autoload_real.php

    r2691584 r2697405  
    33// autoload_real.php @generated by Composer
    44
    5 class ComposerAutoloaderInitcfd64b7794319c2e56256ba8a9836ef5
     5class ComposerAutoloaderInit9f710a513326c38d1f77df8cb4d18344
    66{
    77    private static $loader;
     
    2525        require __DIR__ . '/platform_check.php';
    2626
    27         spl_autoload_register(array('ComposerAutoloaderInitcfd64b7794319c2e56256ba8a9836ef5', 'loadClassLoader'), true, true);
     27        spl_autoload_register(array('ComposerAutoloaderInit9f710a513326c38d1f77df8cb4d18344', 'loadClassLoader'), true, true);
    2828        self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
    29         spl_autoload_unregister(array('ComposerAutoloaderInitcfd64b7794319c2e56256ba8a9836ef5', 'loadClassLoader'));
     29        spl_autoload_unregister(array('ComposerAutoloaderInit9f710a513326c38d1f77df8cb4d18344', 'loadClassLoader'));
    3030
    3131        $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
     
    3333            require __DIR__ . '/autoload_static.php';
    3434
    35             call_user_func(\Composer\Autoload\ComposerStaticInitcfd64b7794319c2e56256ba8a9836ef5::getInitializer($loader));
     35            call_user_func(\Composer\Autoload\ComposerStaticInit9f710a513326c38d1f77df8cb4d18344::getInitializer($loader));
    3636        } else {
    3737            $map = require __DIR__ . '/autoload_namespaces.php';
     
    5454
    5555        if ($useStaticLoader) {
    56             $includeFiles = Composer\Autoload\ComposerStaticInitcfd64b7794319c2e56256ba8a9836ef5::$files;
     56            $includeFiles = Composer\Autoload\ComposerStaticInit9f710a513326c38d1f77df8cb4d18344::$files;
    5757        } else {
    5858            $includeFiles = require __DIR__ . '/autoload_files.php';
    5959        }
    6060        foreach ($includeFiles as $fileIdentifier => $file) {
    61             composerRequirecfd64b7794319c2e56256ba8a9836ef5($fileIdentifier, $file);
     61            composerRequire9f710a513326c38d1f77df8cb4d18344($fileIdentifier, $file);
    6262        }
    6363
     
    6666}
    6767
    68 function composerRequirecfd64b7794319c2e56256ba8a9836ef5($fileIdentifier, $file)
     68function composerRequire9f710a513326c38d1f77df8cb4d18344($fileIdentifier, $file)
    6969{
    7070    if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
  • pxl-tools/trunk/vendor/composer/autoload_static.php

    r2691584 r2697405  
    55namespace Composer\Autoload;
    66
    7 class ComposerStaticInitcfd64b7794319c2e56256ba8a9836ef5
     7class ComposerStaticInit9f710a513326c38d1f77df8cb4d18344
    88{
    99    public static $files = array (
     
    138138    {
    139139        return \Closure::bind(function () use ($loader) {
    140             $loader->prefixLengthsPsr4 = ComposerStaticInitcfd64b7794319c2e56256ba8a9836ef5::$prefixLengthsPsr4;
    141             $loader->prefixDirsPsr4 = ComposerStaticInitcfd64b7794319c2e56256ba8a9836ef5::$prefixDirsPsr4;
    142             $loader->classMap = ComposerStaticInitcfd64b7794319c2e56256ba8a9836ef5::$classMap;
     140            $loader->prefixLengthsPsr4 = ComposerStaticInit9f710a513326c38d1f77df8cb4d18344::$prefixLengthsPsr4;
     141            $loader->prefixDirsPsr4 = ComposerStaticInit9f710a513326c38d1f77df8cb4d18344::$prefixDirsPsr4;
     142            $loader->classMap = ComposerStaticInit9f710a513326c38d1f77df8cb4d18344::$classMap;
    143143
    144144        }, null, ClassLoader::class);
  • pxl-tools/trunk/vendor/composer/installed.php

    r2691584 r2697405  
    77    array (
    88    ),
    9     'reference' => '6992f77bded268719d72f2bdf6f6fa7ce53fa49e',
     9    'reference' => '89d18178436ab03ef748ee1369cba34fd409485d',
    1010    'name' => 'communicatti/pxl',
    1111  ),
     
    1919      array (
    2020      ),
    21       'reference' => '6992f77bded268719d72f2bdf6f6fa7ce53fa49e',
     21      'reference' => '89d18178436ab03ef748ee1369cba34fd409485d',
    2222    ),
    2323    'doctrine/inflector' =>
  • pxl-tools/trunk/vendor/symfony/polyfill-mbstring/bootstrap.php

    r2691584 r2697405  
    1313
    1414if (!function_exists('mb_convert_encoding')) {
    15     function mb_convert_encoding($string, $to_encoding, $from_encoding = null)
    16     {
    17         return p\Mbstring::mb_convert_encoding($string, $to_encoding, $from_encoding);
    18     }
     15    function mb_convert_encoding($string, $to_encoding, $from_encoding = null) { return p\Mbstring::mb_convert_encoding($string, $to_encoding, $from_encoding); }
    1916}
    2017if (!function_exists('mb_decode_mimeheader')) {
    21     function mb_decode_mimeheader($string)
    22     {
    23         return p\Mbstring::mb_decode_mimeheader($string);
    24     }
     18    function mb_decode_mimeheader($string) { return p\Mbstring::mb_decode_mimeheader($string); }
    2519}
    2620if (!function_exists('mb_encode_mimeheader')) {
    27     function mb_encode_mimeheader($string, $charset = null, $transfer_encoding = null, $newline = "\r\n", $indent = 0)
    28     {
    29         return p\Mbstring::mb_encode_mimeheader($string, $charset, $transfer_encoding, $newline, $indent);
    30     }
     21    function mb_encode_mimeheader($string, $charset = null, $transfer_encoding = null, $newline = "\r\n", $indent = 0) { return p\Mbstring::mb_encode_mimeheader($string, $charset, $transfer_encoding, $newline, $indent); }
    3122}
    3223if (!function_exists('mb_decode_numericentity')) {
    33     function mb_decode_numericentity($string, $map, $encoding = null)
    34     {
    35         return p\Mbstring::mb_decode_numericentity($string, $map, $encoding);
    36     }
     24    function mb_decode_numericentity($string, $map, $encoding = null) { return p\Mbstring::mb_decode_numericentity($string, $map, $encoding); }
    3725}
    3826if (!function_exists('mb_encode_numericentity')) {
    39     function mb_encode_numericentity($string, $map, $encoding = null, $hex = false)
    40     {
    41         return p\Mbstring::mb_encode_numericentity($string, $map, $encoding, $hex);
    42     }
     27    function mb_encode_numericentity($string, $map, $encoding = null, $hex = false) { return p\Mbstring::mb_encode_numericentity($string, $map, $encoding, $hex); }
    4328}
    4429if (!function_exists('mb_convert_case')) {
    45     function mb_convert_case($string, $mode, $encoding = null)
    46     {
    47         return p\Mbstring::mb_convert_case($string, $mode, $encoding);
    48     }
     30    function mb_convert_case($string, $mode, $encoding = null) { return p\Mbstring::mb_convert_case($string, $mode, $encoding); }
    4931}
    5032if (!function_exists('mb_internal_encoding')) {
    51     function mb_internal_encoding($encoding = null)
    52     {
    53         return p\Mbstring::mb_internal_encoding($encoding);
    54     }
     33    function mb_internal_encoding($encoding = null) { return p\Mbstring::mb_internal_encoding($encoding); }
    5534}
    5635if (!function_exists('mb_language')) {
    57     function mb_language($language = null)
    58     {
    59         return p\Mbstring::mb_language($language);
    60     }
     36    function mb_language($language = null) { return p\Mbstring::mb_language($language); }
    6137}
    6238if (!function_exists('mb_list_encodings')) {
    63     function mb_list_encodings()
    64     {
    65         return p\Mbstring::mb_list_encodings();
    66     }
     39    function mb_list_encodings() { return p\Mbstring::mb_list_encodings(); }
    6740}
    6841if (!function_exists('mb_encoding_aliases')) {
    69     function mb_encoding_aliases($encoding)
    70     {
    71         return p\Mbstring::mb_encoding_aliases($encoding);
    72     }
     42    function mb_encoding_aliases($encoding) { return p\Mbstring::mb_encoding_aliases($encoding); }
    7343}
    7444if (!function_exists('mb_check_encoding')) {
    75     function mb_check_encoding($value = null, $encoding = null)
    76     {
    77         return p\Mbstring::mb_check_encoding($value, $encoding);
    78     }
     45    function mb_check_encoding($value = null, $encoding = null) { return p\Mbstring::mb_check_encoding($value, $encoding); }
    7946}
    8047if (!function_exists('mb_detect_encoding')) {
    81     function mb_detect_encoding($string, $encodings = null, $strict = false)
    82     {
    83         return p\Mbstring::mb_detect_encoding($string, $encodings, $strict);
    84     }
     48    function mb_detect_encoding($string, $encodings = null, $strict = false) { return p\Mbstring::mb_detect_encoding($string, $encodings, $strict); }
    8549}
    8650if (!function_exists('mb_detect_order')) {
    87     function mb_detect_order($encoding = null)
    88     {
    89         return p\Mbstring::mb_detect_order($encoding);
    90     }
     51    function mb_detect_order($encoding = null) { return p\Mbstring::mb_detect_order($encoding); }
    9152}
    9253if (!function_exists('mb_parse_str')) {
    93     function mb_parse_str($string, &$result = [])
    94     {
    95         parse_str($string, $result);
    96         return (bool) $result;
    97     }
     54    function mb_parse_str($string, &$result = []) { parse_str($string, $result); return (bool) $result; }
    9855}
    9956if (!function_exists('mb_strlen')) {
    100     function mb_strlen($string, $encoding = null)
    101     {
    102         return p\Mbstring::mb_strlen($string, $encoding);
    103     }
     57    function mb_strlen($string, $encoding = null) { return p\Mbstring::mb_strlen($string, $encoding); }
    10458}
    10559if (!function_exists('mb_strpos')) {
    106     function mb_strpos($haystack, $needle, $offset = 0, $encoding = null)
    107     {
    108         return p\Mbstring::mb_strpos($haystack, $needle, $offset, $encoding);
    109     }
     60    function mb_strpos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strpos($haystack, $needle, $offset, $encoding); }
    11061}
    11162if (!function_exists('mb_strtolower')) {
    112     function mb_strtolower($string, $encoding = null)
    113     {
    114         return p\Mbstring::mb_strtolower($string, $encoding);
    115     }
     63    function mb_strtolower($string, $encoding = null) { return p\Mbstring::mb_strtolower($string, $encoding); }
    11664}
    11765if (!function_exists('mb_strtoupper')) {
    118     function mb_strtoupper($string, $encoding = null)
    119     {
    120         return p\Mbstring::mb_strtoupper($string, $encoding);
    121     }
     66    function mb_strtoupper($string, $encoding = null) { return p\Mbstring::mb_strtoupper($string, $encoding); }
    12267}
    12368if (!function_exists('mb_substitute_character')) {
    124     function mb_substitute_character($substitute_character = null)
    125     {
    126         return p\Mbstring::mb_substitute_character($substitute_character);
    127     }
     69    function mb_substitute_character($substitute_character = null) { return p\Mbstring::mb_substitute_character($substitute_character); }
    12870}
    12971if (!function_exists('mb_substr')) {
    130     function mb_substr($string, $start, $length = 2147483647, $encoding = null)
    131     {
    132         return p\Mbstring::mb_substr($string, $start, $length, $encoding);
    133     }
     72    function mb_substr($string, $start, $length = 2147483647, $encoding = null) { return p\Mbstring::mb_substr($string, $start, $length, $encoding); }
    13473}
    13574if (!function_exists('mb_stripos')) {
    136     function mb_stripos($haystack, $needle, $offset = 0, $encoding = null)
    137     {
    138         return p\Mbstring::mb_stripos($haystack, $needle, $offset, $encoding);
    139     }
     75    function mb_stripos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_stripos($haystack, $needle, $offset, $encoding); }
    14076}
    14177if (!function_exists('mb_stristr')) {
    142     function mb_stristr($haystack, $needle, $before_needle = false, $encoding = null)
    143     {
    144         return p\Mbstring::mb_stristr($haystack, $needle, $before_needle, $encoding);
    145     }
     78    function mb_stristr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_stristr($haystack, $needle, $before_needle, $encoding); }
    14679}
    14780if (!function_exists('mb_strrchr')) {
    148     function mb_strrchr($haystack, $needle, $before_needle = false, $encoding = null)
    149     {
    150         return p\Mbstring::mb_strrchr($haystack, $needle, $before_needle, $encoding);
    151     }
     81    function mb_strrchr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strrchr($haystack, $needle, $before_needle, $encoding); }
    15282}
    15383if (!function_exists('mb_strrichr')) {
    154     function mb_strrichr($haystack, $needle, $before_needle = false, $encoding = null)
    155     {
    156         return p\Mbstring::mb_strrichr($haystack, $needle, $before_needle, $encoding);
    157     }
     84    function mb_strrichr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strrichr($haystack, $needle, $before_needle, $encoding); }
    15885}
    15986if (!function_exists('mb_strripos')) {
    160     function mb_strripos($haystack, $needle, $offset = 0, $encoding = null)
    161     {
    162         return p\Mbstring::mb_strripos($haystack, $needle, $offset, $encoding);
    163     }
     87    function mb_strripos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strripos($haystack, $needle, $offset, $encoding); }
    16488}
    16589if (!function_exists('mb_strrpos')) {
    166     function mb_strrpos($haystack, $needle, $offset = 0, $encoding = null)
    167     {
    168         return p\Mbstring::mb_strrpos($haystack, $needle, $offset, $encoding);
    169     }
     90    function mb_strrpos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strrpos($haystack, $needle, $offset, $encoding); }
    17091}
    17192if (!function_exists('mb_strstr')) {
    172     function mb_strstr($haystack, $needle, $before_needle = false, $encoding = null)
    173     {
    174         return p\Mbstring::mb_strstr($haystack, $needle, $before_needle, $encoding);
    175     }
     93    function mb_strstr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strstr($haystack, $needle, $before_needle, $encoding); }
    17694}
    17795if (!function_exists('mb_get_info')) {
    178     function mb_get_info($type = 'all')
    179     {
    180         return p\Mbstring::mb_get_info($type);
    181     }
     96    function mb_get_info($type = 'all') { return p\Mbstring::mb_get_info($type); }
    18297}
    18398if (!function_exists('mb_http_output')) {
    184     function mb_http_output($encoding = null)
    185     {
    186         return p\Mbstring::mb_http_output($encoding);
    187     }
     99    function mb_http_output($encoding = null) { return p\Mbstring::mb_http_output($encoding); }
    188100}
    189101if (!function_exists('mb_strwidth')) {
    190     function mb_strwidth($string, $encoding = null)
    191     {
    192         return p\Mbstring::mb_strwidth($string, $encoding);
    193     }
     102    function mb_strwidth($string, $encoding = null) { return p\Mbstring::mb_strwidth($string, $encoding); }
    194103}
    195104if (!function_exists('mb_substr_count')) {
    196     function mb_substr_count($haystack, $needle, $encoding = null)
    197     {
    198         return p\Mbstring::mb_substr_count($haystack, $needle, $encoding);
    199     }
     105    function mb_substr_count($haystack, $needle, $encoding = null) { return p\Mbstring::mb_substr_count($haystack, $needle, $encoding); }
    200106}
    201107if (!function_exists('mb_output_handler')) {
    202     function mb_output_handler($string, $status)
    203     {
    204         return p\Mbstring::mb_output_handler($string, $status);
    205     }
     108    function mb_output_handler($string, $status) { return p\Mbstring::mb_output_handler($string, $status); }
    206109}
    207110if (!function_exists('mb_http_input')) {
    208     function mb_http_input($type = null)
    209     {
    210         return p\Mbstring::mb_http_input($type);
    211     }
     111    function mb_http_input($type = null) { return p\Mbstring::mb_http_input($type); }
    212112}
    213113
    214114if (!function_exists('mb_convert_variables')) {
    215     function mb_convert_variables($to_encoding, $from_encoding, &...$vars)
    216     {
    217         return p\Mbstring::mb_convert_variables($to_encoding, $from_encoding, ...$vars);
    218     }
     115    function mb_convert_variables($to_encoding, $from_encoding, &...$vars) { return p\Mbstring::mb_convert_variables($to_encoding, $from_encoding, ...$vars); }
    219116}
    220117
    221118if (!function_exists('mb_ord')) {
    222     function mb_ord($string, $encoding = null)
    223     {
    224         return p\Mbstring::mb_ord($string, $encoding);
    225     }
     119    function mb_ord($string, $encoding = null) { return p\Mbstring::mb_ord($string, $encoding); }
    226120}
    227121if (!function_exists('mb_chr')) {
    228     function mb_chr($codepoint, $encoding = null)
    229     {
    230         return p\Mbstring::mb_chr($codepoint, $encoding);
    231     }
     122    function mb_chr($codepoint, $encoding = null) { return p\Mbstring::mb_chr($codepoint, $encoding); }
    232123}
    233124if (!function_exists('mb_scrub')) {
    234     function mb_scrub($string, $encoding = null)
    235     {
    236         $encoding = null === $encoding ? mb_internal_encoding() : $encoding;
    237         return mb_convert_encoding($string, $encoding, $encoding);
    238     }
     125    function mb_scrub($string, $encoding = null) { $encoding = null === $encoding ? mb_internal_encoding() : $encoding; return mb_convert_encoding($string, $encoding, $encoding); }
    239126}
    240127if (!function_exists('mb_str_split')) {
    241     function mb_str_split($string, $length = 1, $encoding = null)
    242     {
    243         return p\Mbstring::mb_str_split($string, $length, $encoding);
    244     }
     128    function mb_str_split($string, $length = 1, $encoding = null) { return p\Mbstring::mb_str_split($string, $length, $encoding); }
    245129}
    246130
Note: See TracChangeset for help on using the changeset viewer.