Changeset 13819 for sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/theme-directory.php
- Timestamp:
- 06/14/2024 03:24:50 AM (22 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/theme-directory.php
r13563 r13819 1542 1542 return 200 === wp_remote_retrieve_response_code( $request ); 1543 1543 } 1544 1545 /** 1546 * Record some stats on theme status changes. 1547 * 1548 * @param string $new_status 1549 * @param string $old_status 1550 * @param WP_Post $post 1551 */ 1552 function wporg_themes_status_change_stats( $new_status, $old_status, $post ) { 1553 if ( 1554 'repopackage' !== $post->post_type || 1555 in_array( $new_status, [ 'draft', 'auto-draft' ] ) || 1556 ! function_exists( 'bump_stats_extras' ) 1557 ) { 1558 return; 1559 } 1560 1561 if ( 'suspended' == $old_status && 'publish' == $new_status ) { 1562 $stat = 'reinstated'; 1563 } elseif( 'delist' == $old_status && 'publish' == $new_status ) { 1564 $stat = 'relisted'; 1565 } else { 1566 $stat = $new_status; 1567 } 1568 1569 bump_stats_extras( 'themes', 'status-' . $stat ); 1570 } 1571 add_action( 'transition_post_status', 'wporg_themes_status_change_stats', 10, 3 );
Note: See TracChangeset
for help on using the changeset viewer.