Plugin Directory

Changeset 2572600


Ignore:
Timestamp:
07/26/2021 08:17:46 PM (5 years ago)
Author:
IT-RAYS
Message:

— Fixed some php errors while activating.
— Fixed some minor JS Errors.
— Tested up to WP 5.8.

Location:
rays-grid
Files:
87 added
7 edited

Legend:

Unmodified
Added
Removed
  • rays-grid/trunk/assets/admin/js/script.js

    r2361557 r2572600  
    409409                }
    410410
    411                 that.click(function () {
     411                that.on('click', function () {
     412
     413                    let vl = that.find('input[type="radio"]').val();
    412414
    413415                    $('.portfolio-item input[type="radio"]').removeAttr('checked');
     
    416418                    $('.portfolio-item').removeClass('selected-skin');
    417419                    that.addClass('selected-skin');
     420
     421                    $('.rsgd-choose-skin').attr('value', vl);
    418422
    419423                });
  • rays-grid/trunk/includes/array_column.php

    r1792096 r2572600  
    11<?php
    2 /**
    3  * This file is part of the array_column library
    4  *
    5  * For the full copyright and license information, please view the LICENSE
    6  * file that was distributed with this source code.
    7  *
    8  * @copyright Copyright (c) Ben Ramsey (http://benramsey.com)
    9  * @license http://opensource.org/licenses/MIT MIT
    10  */
    112
    123if (!function_exists('array_column')) {
    13     /**
    14      * Returns the values from a single column of the input array, identified by
    15      * the $columnKey.
    16      *
    17      * Optionally, you may provide an $indexKey to index the values in the returned
    18      * array by the values from the $indexKey column in the input array.
    19      *
    20      * @param array $input A multi-dimensional array (record set) from which to pull
    21      *                     a column of values.
    22      * @param mixed $columnKey The column of values to return. This value may be the
    23      *                         integer key of the column you wish to retrieve, or it
    24      *                         may be the string key name for an associative array.
    25      * @param mixed $indexKey (Optional.) The column to use as the index/keys for
    26      *                        the returned array. This value may be the integer key
    27      *                        of the column, or it may be the string key name.
    28      * @return array
    29      */
    30     function array_column($input = null, $columnKey = null, $indexKey = null)
    31     {
    32         // Using func_get_args() in order to check for proper number of
    33         // parameters and trigger errors exactly as the built-in array_column()
    34         // does in PHP 5.5.
    35         $argc = func_num_args();
    36         $params = func_get_args();
    374
    38         if ($argc < 2) {
    39             trigger_error("array_column() expects at least 2 parameters, {$argc} given", E_USER_WARNING);
    40             return null;
    41         }
    42 
    43         if (!is_array($params[0])) {
    44             trigger_error(
    45                 'array_column() expects parameter 1 to be array, ' . gettype($params[0]) . ' given',
    46                 E_USER_WARNING
    47             );
    48             return null;
    49         }
    50 
    51         if (!is_int($params[1])
    52             && !is_float($params[1])
    53             && !is_string($params[1])
    54             && $params[1] !== null
    55             && !(is_object($params[1]) && method_exists($params[1], '__toString'))
    56         ) {
    57             trigger_error('array_column(): The column key should be either a string or an integer', E_USER_WARNING);
    58             return false;
    59         }
    60 
    61         if (isset($params[2])
    62             && !is_int($params[2])
    63             && !is_float($params[2])
    64             && !is_string($params[2])
    65             && !(is_object($params[2]) && method_exists($params[2], '__toString'))
    66         ) {
    67             trigger_error('array_column(): The index key should be either a string or an integer', E_USER_WARNING);
    68             return false;
    69         }
    70 
    71         $paramsInput = $params[0];
    72         $paramsColumnKey = ($params[1] !== null) ? (string) $params[1] : null;
    73 
    74         $paramsIndexKey = null;
    75         if (isset($params[2])) {
    76             if (is_float($params[2]) || is_int($params[2])) {
    77                 $paramsIndexKey = (int) $params[2];
    78             } else {
    79                 $paramsIndexKey = (string) $params[2];
    80             }
    81         }
    82 
    83         $resultArray = array();
    84 
    85         foreach ($paramsInput as $row) {
    86             $key = $value = null;
    87             $keySet = $valueSet = false;
    88 
    89             if ($paramsIndexKey !== null && array_key_exists($paramsIndexKey, $row)) {
    90                 $keySet = true;
    91                 $key = (string) $row[$paramsIndexKey];
    92             }
    93 
    94             if ($paramsColumnKey === null) {
    95                 $valueSet = true;
    96                 $value = $row;
    97             } elseif (is_array($row) && array_key_exists($paramsColumnKey, $row)) {
    98                 $valueSet = true;
    99                 $value = $row[$paramsColumnKey];
    100             }
    101 
    102             if ($valueSet) {
    103                 if ($keySet) {
    104                     $resultArray[$key] = $value;
    105                 } else {
    106                     $resultArray[] = $value;
    107                 }
    108             }
    109 
    110         }
    111 
    112         return $resultArray;
     5    function array_column(array $input, $columnKey, $indexKey = null) {
     6        $array = array();
     7        foreach ($input as $value) {
     8            if ( !array_key_exists($columnKey, $value)) {
     9                trigger_error("Key \"$columnKey\" does not exist in array");
     10                return false;
     11            }
     12            if (is_null($indexKey)) {
     13                $array[] = $value[$columnKey];
     14            }
     15            else {
     16                if ( !array_key_exists($indexKey, $value)) {
     17                    trigger_error("Key \"$indexKey\" does not exist in array");
     18                    return false;
     19                }
     20                if ( ! is_scalar($value[$indexKey])) {
     21                    trigger_error("Key \"$indexKey\" does not contain scalar value");
     22                    return false;
     23                }
     24                $array[$value[$indexKey]] = $value[$columnKey];
     25            }
     26        }
     27        return $array;
    11328    }
    11429
  • rays-grid/trunk/includes/class-base.php

    r2362412 r2572600  
    207207            'publicly_queryable'    => true,
    208208            'rewrite'               => array('slug' => $post_type_name ),
     209            'show_in_rest'          => true,
    209210            'capability_type'       => 'post',
    210211            'hierarchical'          => false,
  • rays-grid/trunk/includes/class-db.php

    r2057751 r2572600  
    3434    }
    3535
    36     public function rsgd_AddSQL() {
     36    public static function rsgd_AddSQL() {
    3737       
    3838        global $wpdb;
     
    4848    }
    4949
    50     public function rsgd_forLoop() {
     50    public static function rsgd_forLoop() {
    5151       
    5252        $configs = new raysgrid_Config();
     
    6565    }
    6666
    67     public function rsgd_defult_args() {
     67    public static function rsgd_defult_args() {
    6868       
    6969        $defults = array (
     
    130130        global $wpdb;
    131131       
    132         if ( isset( $_POST['rsgd_nonce_fields'] ) && ! wp_verify_nonce( $_POST['rsgd_nonce_fields'], 'rsgd_nonce_fields' ) && !current_user_can( 'edit_others_posts' ) ) { return; }
     132        if ( ( isset( $_POST['rsgd_nonce_fields'] ) || ! wp_verify_nonce( $_POST['rsgd_nonce_fields'], 'rsgd_nonce_fields' ) ) && !current_user_can( 'edit_others_posts' ) ) {
     133            return;
     134        }
    133135       
    134136        $rsgd_title     = ( isset($_POST['rsgd_data']['title']) ) ? $_POST['rsgd_data']['title'] : "";
  • rays-grid/trunk/includes/display-field.php

    r2057751 r2572600  
    9898
    9999                foreach ($choices as $key => $value) {
    100                     $output .= ' <div class="' . $class . '"><input id="' . $name . '" data-name="' . esc_attr($value) . '" type="radio" name="rsgd_data[' . $name . ']" value="' . esc_attr($key) . '"';
     100                    $output .= ' <div class="' . $class . '"><input id="' . $name . '" data-name="' . esc_attr($value) . '" type="radio" name="' . $key . '" value="' . esc_attr($key) . '"';
    101101                    if ($key == $val) {
    102102                        $output .= 'checked="checked"';
     
    104104                    $output .= '><label class="radio-lbl">'.esc_attr($value).'</label></div>';
    105105                }
     106                $output .= '<input class="rsgd-choose-skin" id="' . $name . '" data-name="' . esc_attr($value) . '" type="hidden" name="rsgd_data[' . $name . ']" value="' . esc_attr($value) . '" />';
    106107                break;
    107108
  • rays-grid/trunk/rays-grid.php

    r2362418 r2572600  
    44  Plugin URI: https://www.it-rays.org/raysgrid
    55  Description: WordPress Plugin for showing Grids with Custom Styles.
    6   Version: 1.2.2
     6  Version: 1.2.3
    77  Author: IT-RAYS
    88  Author URI: https://themeforest.net/user/it-rays/portfolio
  • rays-grid/trunk/readme.txt

    r2362418 r2572600  
    33    Donate link: https://themeforest.net/user/it-rays/portfolio
    44    Tags: rays grid, grid, custom post grid, post type grid, portfolio grid, portfolio masonry, grid display, category filter, custom post, isotope, filter, filtering, grid, layout, list, masonry, post, post filter, post layout
    5     Requires at least: 5.1
    6     Tested up to: 5.5
     5    Requires at least: 5.7
     6    Tested up to: 5.8
    77    Requires PHP: 5.6 or later
    8     Stable tag: 1.2.2
     8    Stable tag: 1.2.3
    99    License: GPLv2 or later
    1010    License URI: http://www.gnu.org/licenses/gpl-2.0.html
Note: See TracChangeset for help on using the changeset viewer.