Make WordPress Core

Ticket #23634: 23634.4.patch

File 23634.4.patch, 2.6 KB (added by keesiemeijer, 7 years ago)

after_comment filter

  • src/wp-includes/class-walker-comment.php

     
    192192        }
    193193
    194194        /**
     195         * After the element output has started.
     196         *
     197         * @param string     $output  Used to append additional content after an element. Passed by reference.
     198         * @param WP_Comment $comment Comment data object.
     199         * @param int        $depth   Optional. Depth of the current comment in reference to parents. Default 0.
     200         * @param array      $args    Optional. An array of arguments. Default empty array.
     201         */
     202        public function start_el_after( &$output, $comment, $depth = 0, $args = array() ) {
     203                /**
     204                 * Filter to add content after comment HTML.
     205                 *
     206                 * @param string     $after_comment HTML after a comment. Default empty string
     207                 * @param WP_Comment $comment       The current comment object. Default current comment.
     208                 * @param int        $depth         Depth of the current comment in reference to parents.
     209                 * @param array      $args          An array of arguments.
     210                 */
     211                $output .= apply_filters( 'after_comment', '', $comment, $depth, $args );
     212        }
     213
     214        /**
    195215         * Ends the element output, if needed.
    196216         *
    197217         * @since 2.7.0
  • src/wp-includes/class-wp-walker.php

     
    6262        public function start_lvl( &$output, $depth = 0, $args = array() ) {}
    6363
    6464        /**
     65         * After the element output has started.
     66         *
     67         * The $args parameter holds additional values that may be used with the child class methods.
     68         *
     69         * @since X.X.X
     70         * @abstract
     71         *
     72         * @param string $output Passed by reference. Used to append additional content.
     73         * @param object $object The data object.
     74         * @param int    $depth  Depth of the item.
     75         * @param array  $args   An array of additional arguments.
     76         */
     77        public function start_el_after( &$output, $object, $depth = 0, $args = array() ) {}
     78
     79        /**
    6580         * Ends the list of after the elements are added.
    6681         *
    6782         * The $args parameter holds additional values that may be used with the child
     
    143158
    144159                $cb_args = array_merge( array(&$output, $element, $depth), $args);
    145160                call_user_func_array(array($this, 'start_el'), $cb_args);
     161                call_user_func_array( array( $this, 'start_el_after' ), $cb_args );
    146162
    147163                // descend only when the depth is right and there are childrens for this element
    148164                if ( ($max_depth == 0 || $max_depth > $depth+1 ) && isset( $children_elements[$id]) ) {