Make WordPress Core

Ticket #33587: 33587-3.diff

File 33587-3.diff, 2.9 KB (added by dshanske, 10 years ago)

Add Hooks

  • wp-includes/comment-functions.php

     
    16311631
    16321632        if ( 'spam' !== $commentdata['comment_approved'] ) { // If it's spam save it silently for later crunching
    16331633                if ( '0' == $commentdata['comment_approved'] ) {
    1634                         wp_notify_moderator( $comment_ID );
     1634          /**
     1635                 * Notifies the Moderator when a Comment Needs Approval.
     1636           *
     1637           * @since
     1638           *
     1639           * @param int $comment_ID       The comment ID.
     1640           */
     1641                                do_action( 'wp_notify_moderator', $comment_ID );
    16351642                }
    16361643
    16371644                // wp_notify_postauthor() checks if notifying the author of their own comment.
    16381645                // By default, it won't, but filters can override this.
    16391646                if ( get_option( 'comments_notify' ) && $commentdata['comment_approved'] ) {
    1640                         wp_notify_postauthor( $comment_ID );
     1647    /**
     1648     * Notifies the Post Author of a New Comment.
     1649     *
     1650     * @since
     1651     *
     1652     * @param int $comment_ID       The comment ID.
     1653     */
     1654                                do_action( 'wp_notify_postauthor', $comment_ID );
    16411655                }
    16421656        }
    16431657
  • wp-includes/default-filters.php

     
    334334add_action( 'split_shared_term', '_wp_check_split_nav_menu_terms', 10, 4 );
    335335add_action( 'wp_split_shared_term_batch', '_wp_batch_split_terms' );
    336336
     337// Default Notification Filters.
     338add_action( 'wp_notify_postauthor', 'wp_notify_postauthor' );
     339add_action( 'wp_notify_moderator', 'wp_notify_moderator' );
     340add_action( 'wp_new_user_notification', 'wp_new_user_notification', 10, 2 );
     341add_action( 'wp_password_change_notification', 'wp_password_change_notification' );
     342
    337343/**
    338344 * Filters formerly mixed into wp-includes
    339345 */
  • wp-includes/user-functions.php

     
    19151915
    19161916        wp_set_password( $new_pass, $user->ID );
    19171917        update_user_option( $user->ID, 'default_password_nag', false, true );
    1918 
    1919         wp_password_change_notification( $user );
     1918        /**
     1919         * Notifies of a Password Change.
     1920         *
     1921         * @since
     1922         *
     1923         * @param object $user       The user.
     1924         */
     1925        do_action( 'wp_password_change_notification', $user );
    19201926}
    19211927
    19221928/**
     
    20032009        }
    20042010
    20052011        update_user_option( $user_id, 'default_password_nag', true, true ); //Set up the Password change nag.
     2012        /**
     2013         * Notifies of a New User.
     2014         *
     2015         * @since
     2016         *
     2017         * @param int $user_ID       The user ID.
     2018         * @param string $notify  (Optional) Whether admin and user should be notified ('both') or only the admin ('admin' or empty).
     2019        */
     2020        do_action( 'wp_new_user_notification', $user_id, 'both' );
    20062021
    2007         wp_new_user_notification( $user_id, 'both' );
    2008 
    20092022        return $user_id;
    20102023}
    20112024