Make WordPress Core

Ticket #34309: 34309.patch

File 34309.patch, 1.6 KB (added by sebastian.pisula, 9 years ago)
  • wp-includes/plugin.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    110110}
    111111
    112112/**
     113 * Hook a function or method to a specific filter action.
     114 *
     115 * @since 4.4.0
     116 *
     117 * @param array $tags
     118 * @param callable $function_to_add
     119 * @param int $priority
     120 * @param int $accepted_args
     121 *
     122 * @return bool
     123 */
     124function add_multiple_filters( $tags, $function_to_add, $priority = 10, $accepted_args = 1 )
     125{
     126        if ( ! empty( $tags ) && is_array( $tags )) {
     127                foreach ($tags AS $tag) {
     128                        add_filter( $tag, $function_to_add, $priority, $accepted_args );
     129                }
     130
     131                return true;
     132        }
     133
     134        return false;
     135}
     136
     137/**
    113138 * Check if any filter has been registered for a hook.
    114139 *
    115140 * @since 2.5.0
     
    456481 */
    457482function add_action($tag, $function_to_add, $priority = 10, $accepted_args = 1) {
    458483        return add_filter($tag, $function_to_add, $priority, $accepted_args);
     484}
     485
     486/**
     487 * Hooks a function on to a specific action.
     488 *
     489 * @since 4.4.0
     490 *
     491 * @param array $tags
     492 * @param callable $function_to_add
     493 * @param int $priority
     494 * @param int $accepted_args
     495 *
     496 * @return bool
     497 */
     498function add_multiple_actions( $tags, $function_to_add, $priority = 10, $accepted_args = 1 )
     499{
     500        return add_multiple_filters( $tags, $function_to_add, $priority, $accepted_args );
    459501}
    460502
    461503/**