Changeset 12594 for sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/class-customizations.php
- Timestamp:
- 05/18/2023 03:26:43 AM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/class-customizations.php
r12591 r12594 69 69 add_action( 'save_post', array( __NAMESPACE__ . '\Metabox\Author_Notice', 'save_post' ) ); 70 70 add_action( 'save_post', array( __NAMESPACE__ . '\Metabox\Reviewer', 'save_post' ) ); 71 72 // Audit logs73 add_action( 'updated_postmeta', array( $this, 'updated_postmeta' ), 10, 4 );74 71 } 75 72 … … 858 855 return $keys; 859 856 } 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_login872 ),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 }879 857 }
Note: See TracChangeset
for help on using the changeset viewer.