Making WordPress.org


Ignore:
Timestamp:
05/18/2023 03:26:43 AM (2 years ago)
Author:
dd32
Message:

Plugin Directory: Clear the assigned reviewer on the appropriate status transitions (->approved and ->publish).

See #6993.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/class-customizations.php

    r12591 r12594  
    6969        add_action( 'save_post', array( __NAMESPACE__ . '\Metabox\Author_Notice', 'save_post' ) );
    7070        add_action( 'save_post', array( __NAMESPACE__ . '\Metabox\Reviewer', 'save_post' ) );
    71 
    72         // Audit logs
    73         add_action( 'updated_postmeta', array( $this, 'updated_postmeta' ), 10, 4 );
    7471    }
    7572
     
    858855        return $keys;
    859856    }
    860 
    861     /**
    862      * Watch for post_meta updates and log accordingly.
    863      */
    864     public function updated_postmeta( $meta_id, $post_id, $meta_key, $meta_value ) {
    865         if ( 'assigned_reviewer' === $meta_key && $meta_value ) {
    866             $reviewer = get_user_by( 'id', $meta_value );
    867             Tools::audit_log(
    868                 sprintf(
    869                     'Assigned to <a href="%s">%s</a>.',
    870                     esc_url( 'https://profiles.wordpress.org/' . $reviewer->user_nicename . '/' ),
    871                     $reviewer->display_name ?: $reviewer->user_login
    872                 ),
    873                 get_post( $post_id )
    874             );
    875         } elseif ( 'assigned_reviewer' === $meta_key && ! $meta_value ) {
    876             Tools::audit_log( 'Unassigned.', get_post( $post_id ) );
    877         }
    878     }
    879857}
Note: See TracChangeset for help on using the changeset viewer.