Changeset 14465
- Timestamp:
- 06/11/2025 06:39:42 AM (4 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/theme-directory.php
r14463 r14465 393 393 exit; 394 394 } 395 add_action( 'wp_ajax_author-lookup', 'wporg_themes_author_lookup');395 add_action( 'wp_ajax_author-lookup', 'wporg_themes_author_lookup' ); 396 396 397 397 … … 1580 1580 1581 1581 /** 1582 * Record the date a theme was put into it's current status. 1583 * 1584 * @param string $new_status 1585 * @param string $old_status 1586 * @param WP_Post $post 1587 */ 1588 function wporg_themes_status_change_metadata( $new_status, $old_status, $post ) { 1589 $tracked_statii = [ 1590 'publish', 1591 'suspend', 1592 'delist', 1593 ]; 1594 1595 if ( 1596 'repopackage' !== $post->post_type || 1597 $new_status === $old_status || 1598 ( 1599 ! in_array( $new_status, $tracked_statii ) && 1600 ! in_array( $old_status, $tracked_statii ) 1601 ) 1602 ) { 1603 return; 1604 } 1605 1606 foreach ( $tracked_statii as $status ) { 1607 delete_post_meta( $post->ID, "_{$status}_date" ); 1608 } 1609 1610 if ( in_array( $new_status, $tracked_statii ) ) { 1611 update_post_meta( $post->ID, "_{$new_status}_date", current_time( 'mysql' ) ); 1612 } 1613 1614 } 1615 add_action( 'transition_post_status', 'wporg_themes_status_change_metadata', 10, 3 ); 1616 1617 /** 1582 1618 * Check if a user has any themes. 1583 1619 * … … 1612 1648 */ 1613 1649 function wporg_themes_log_metadata_changes( $meta_keys ) { 1650 // Don't keep track of the page template, we don't use that. 1651 $meta_keys = array_diff( 1652 $meta_keys, 1653 array( 1654 '_wp_page_template' 1655 ) 1656 ); 1657 1614 1658 $meta_keys[] = '_live_version'; 1615 1659 $meta_keys[] = 'external_support_url';
Note: See TracChangeset
for help on using the changeset viewer.