Changeset 12917
- Timestamp:
- 09/25/2023 11:29:08 PM (18 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/theme-directory.php
r12916 r12917 724 724 725 725 $trace = wp_debug_backtrace_summary(); 726 $message = __FUNCTION__ . " trace: " . $trace;726 $message = __FUNCTION__ . " - slug: $theme_slug - version: $theme_version - trace: $trace"; 727 727 slack_dm( $message, 'iandunn' ); 728 728 } … … 1151 1151 * @param int $post_id The post ID being published 1152 1152 */ 1153 function wporg_themes_glotpress_mark_as_active_on_publish( $post_id ) { 1154 $post = get_post( $post_id ); 1153 function wporg_themes_glotpress_mark_as_active_on_publish( $post_id, $post, $old_status ) { 1154 // This is only intended to handle when a suspended/delisted theme is reinstated. Other functions handle when 1155 // a new version of a published theme is uploaded. 1156 if ( 'publish' === $old_status ) { 1157 return; 1158 } 1159 1155 1160 $latest_version = array_search( 'live', $post->_status ?: [] ); 1161 1156 1162 if ( ! $latest_version ) { 1157 1163 return; … … 1159 1165 1160 1166 wporg_themes_glotpress_import( $post, $latest_version ); 1167 1161 1168 wporg_themes_update_wpthemescom( $post->post_name, $latest_version ); 1162 1169 } 1163 add_action( 'publish_repopackage', 'wporg_themes_glotpress_mark_as_active_on_publish', 10 0);1170 add_action( 'publish_repopackage', 'wporg_themes_glotpress_mark_as_active_on_publish', 10, 3 ); 1164 1171 1165 1172 /**
Note: See TracChangeset
for help on using the changeset viewer.