Plugin Directory

Changeset 2754211


Ignore:
Timestamp:
07/10/2022 03:19:48 PM (4 years ago)
Author:
alvinmuthui
Message:

Added more parameters to some filters

Location:
tori-ajax
Files:
23 added
5 edited

Legend:

Unmodified
Added
Removed
  • tori-ajax/trunk/README.txt

    r2732261 r2754211  
    55Requires at least: 3.0.0
    66Tested up to:  6.0
    7 Stable tag: 1.1.0
     7Stable tag: 1.2.0
    88Requires PHP: 5.6.20
    99License: GPLv2 or later
     
    5959tori_ajax();// call the function.
    6060~~~~
     61
     62== Documentation ==
     63
     64Please check out the [Tori Ajax plugin Documentation](https://toriajax.com/documentation)
    6165
    6266== Frequently Asked Questions ==
     
    175179`apply_filters( 'toria/ajax/ajax_variables', $ajax_variables, $action, $php_callback, $script_path, $mode );`
    176180
     181= 1.2.0 =
     182*Added more parameters to some filters.
     183*The affected filters are:
     184`apply_filters( 'toria/ajax/ajax_object', $ajax_object, $action, $php_callback, $script_path, $mode, $nonce );`
     185`apply_filters( 'toria/ajax/ajax_handle', $ajax_handle, $action, $php_callback, $script_path, $mode, $nonce, $ajax_object );`
     186`apply_filters( 'toria/ajax/script_depends', $script_depends, $action, $php_callback, $script_path, $mode, $nonce, $ajax_object, $ajax_handle );`
     187`apply_filters( 'toria/ajax/script_version', $script_version, $action, $php_callback, $script_path, $mode, $nonce, $ajax_object, $ajax_handle, $script_depends );`
     188`apply_filters( 'toria/ajax/script_in_footer', $script_in_footer, $action, $php_callback, $script_path, $mode, $nonce, $ajax_object, $ajax_handle, $script_depends, $script_version );`
     189`apply_filters( 'toria/ajax/ajax_variables', $ajax_variables, $action, $php_callback, $script_path, $mode, $nonce, $ajax_object, $ajax_handle, $script_depends, $script_version, $script_in_footer );`
    177190
    178191== Upgrade Notice ==
    179192
    180 = 1.1.0 =
    181 * Added filters for the variables and compatible with WordPress 6.0.
     193= 1.2.0 =
     194* Added more parameters to some filters.
    182195
    183196== About ==
  • tori-ajax/trunk/includes/ajax/class-toria-ajax.php

    r2732261 r2754211  
    172172        $this->mode             = apply_filters( 'toria/ajax/mode', $mode, $this->action, $this->php_callback, $this->script_path );// phpcs:ignore
    173173        $this->nonce            = apply_filters( 'toria/ajax/nonce', $nonce, $this->action, $this->php_callback, $this->script_path, $this->mode );// phpcs:ignore
    174         $this->ajax_object      = apply_filters( 'toria/ajax/ajax_object', $ajax_object, $this->action, $this->php_callback, $this->script_path, $this->mode );// phpcs:ignore
    175         $this->ajax_handle      = apply_filters( 'toria/ajax/ajax_handle', $ajax_handle, $this->action, $this->php_callback, $this->script_path, $this->mode );// phpcs:ignore
    176         $this->script_depends   = apply_filters( 'toria/ajax/script_depends', $script_depends, $this->action, $this->php_callback, $this->script_path, $this->mode );// phpcs:ignore
    177         $this->script_version   = apply_filters( 'toria/ajax/script_version', $script_version, $this->action, $this->php_callback, $this->script_path, $this->mode );// phpcs:ignore
    178         $this->script_in_footer = apply_filters( 'toria/ajax/script_in_footer', $script_in_footer, $this->action, $this->php_callback, $this->script_path, $this->mode );// phpcs:ignore
     174        $this->ajax_object      = apply_filters( 'toria/ajax/ajax_object', $ajax_object, $this->action, $this->php_callback, $this->script_path, $this->mode, $this->nonce );// phpcs:ignore
     175        $this->ajax_handle      = apply_filters( 'toria/ajax/ajax_handle', $ajax_handle, $this->action, $this->php_callback, $this->script_path, $this->mode, $this->nonce, $this->ajax_object );// phpcs:ignore
     176        $this->script_depends   = apply_filters( 'toria/ajax/script_depends', $script_depends, $this->action, $this->php_callback, $this->script_path, $this->mode, $this->nonce, $this->ajax_object, $this->ajax_handle );// phpcs:ignore
     177        $this->script_version   = apply_filters( 'toria/ajax/script_version', $script_version, $this->action, $this->php_callback, $this->script_path, $this->mode, $this->nonce, $this->ajax_object, $this->ajax_handle, $this->script_depends );// phpcs:ignore
     178        $this->script_in_footer = apply_filters( 'toria/ajax/script_in_footer', $script_in_footer, $this->action, $this->php_callback, $this->script_path, $this->mode, $this->nonce, $this->ajax_object, $this->ajax_handle, $this->script_depends, $this->script_version );// phpcs:ignore
    179179
    180180        if ( ! array_key_exists( 'ajax_url', $ajax_variables ) ) {
     
    188188        }
    189189        // phpcs:ignore
    190         $this->ajax_variables = apply_filters( 'toria/ajax/ajax_variables', $ajax_variables, $this->action, $this->php_callback, $this->script_path, $this->mode );
     190        $this->ajax_variables = apply_filters( 'toria/ajax/ajax_variables', $ajax_variables, $this->action, $this->php_callback, $this->script_path, $this->mode, $this->nonce, $this->ajax_object, $this->ajax_handle, $this->script_depends, $this->script_version, $this->script_in_footer );
    191191
    192192        $this->create_ajax();
  • tori-ajax/trunk/includes/class-toria-ajax-api.php

    r2715093 r2754211  
    4747     * @param array  $ajax_variables Variables to be passed to be available for JS to utilize.
    4848     * @param string $nonce string used to create WP nonce for verification on PHP callback.
    49      * @param string $ajax_object Name of object to be storing JS variables.
     49     * @param string $ajax_object (string) Name of object to be storing JS variables.
    5050     * @param string $ajax_handle Name of script.
    5151     * @param array  $script_depends An array of registered script handles this script depends on.
  • tori-ajax/trunk/includes/class-toria.php

    r2732261 r2754211  
    9797            $this->version = TORIA_VERSION;
    9898        } else {
    99             $this->version = '1.1.0';
     99            $this->version = '1.2.0';
    100100        }
    101101        $this->plugin_name  = 'toria';
     
    210210     * @param array  $ajax_variables Variables to be passed to be available for JS to utilize.
    211211     * @param string $nonce string used to create WP nonce for verification on PHP callback.
    212      * @param string $ajax_object Name of object to be storing JS variables.
     212     * @param string $ajax_object (string) Name of object to be storing JS variables.
    213213     * @param string $ajax_handle Name of script.
    214214     * @param array  $script_depends An array of registered script handles this script depends on.
  • tori-ajax/trunk/toria.php

    r2732261 r2754211  
    1616 * Plugin URI:        http://toriajax.com/
    1717 * Description:       Adds Ajax in WordPress with a few lines of code.
    18  * Version:           1.1.0
     18 * Version:           1.2.0
    1919 * Author:            Alvin Muthui
    2020 * Author URI:        https://profiles.wordpress.org/alvinmuthui/
     
    3333 * Currently plugin version.
    3434 */
    35 define( 'TORIA_VERSION', '1.1.0' );
     35define( 'TORIA_VERSION', '1.2.0' );
    3636
    3737/**
     
    8383 * Adds Ajax scripts and their associated actions and callback
    8484 *
    85  * @param string $action The name of action.
     85 * @param string $action The name of the Ajax action.
    8686 * @param mixed  $php_callback PHP function to respond to ajax calls.
    8787 * @param string $script_path File path containing you Javascript file.
    88  * @param string $mode Determines if script will be exposed to authenticated Ajax actions for logged-in users or non-authenticated Ajax actions for logged-out users or both. Using both, private, and public.
     88 * @param string $mode (string) Determines if script will be exposed to authenticated Ajax actions for logged-in users or non-authenticated Ajax actions for logged-out users or both. Using both, private, and public.
    8989 * @param array  $ajax_variables Variables to be passed to be available for JS to utilize.
    90  * @param string $nonce string used to create WP nonce for verification on PHP callback.
    91  * @param string $ajax_object Name of object to be storing JS variables.
     90 * @param string $nonce (string) Used to create WP nonce for verification on PHP callback.
     91 * @param string $ajax_object (string) Name of object to be storing JS variables.
    9292 * @param string $ajax_handle Name of script.
    9393 * @param array  $script_depends (string[]) (Optional) An array of registered script handles this script depends on. Default value: array().
    9494 * @param mixed  $script_version String specifying script version number, if it has one, which is added to the URL as a query string for cache busting purposes. If the version is set to false, a version number is automatically added equal to the current installed Tori Ajax version. If set to null, no version is added. Default value: false.
    9595 * @param bool   $script_in_footer (bool) (Optional) Whether to enqueue the script before </body> instead of in the <head>. Default 'false'.
    96  * @return boolean Whether it is added or not.
     96 * @return bool Whether it is added or not.
    9797 *
    9898 * @since    1.0.0
Note: See TracChangeset for help on using the changeset viewer.