Changeset 12845 for sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/theme-directory.php
- Timestamp:
- 08/17/2023 04:10:57 AM (21 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/theme-directory.php
r12600 r12845 1118 1118 1119 1119 /** 1120 * Hooks into the Suspend process to mark a theme as inactive in GlotPress.1120 * Hooks into the Suspend/Draft process to mark a theme as inactive in GlotPress. 1121 1121 * 1122 1122 * @param int $post_id The post ID being suspended … … 1129 1129 1130 1130 wporg_themes_glotpress_import( $post, 'inactive' ); 1131 wporg_themes_remove_wpthemescom( $post->post_name ); 1131 1132 } 1132 1133 add_action( 'suspend_repopackage', 'wporg_themes_glotpress_mark_as_inactive_on_suspend' ); 1134 add_action( 'publish_to_draft', 'wporg_themes_glotpress_mark_as_inactive_on_suspend' ); 1135 1136 /** 1137 * Hooks into the publish process to mark a theme as active in GlotPress if it was deactivated. 1138 * 1139 * @param int $post_id The post ID being published 1140 */ 1141 function wporg_themes_glotpress_mark_as_active_on_publish( $post_id ) { 1142 $post = get_post( $post_id ); 1143 $latest_version = array_search( 'live', $post->_status ?: [] ); 1144 if ( ! $latest_version ) { 1145 return; 1146 } 1147 1148 wporg_themes_glotpress_import( $post, $latest_version ); 1149 wporg_themes_update_wpthemescom( $post->post_name, $latest_version ); 1150 } 1151 add_action( 'publish_repopackage', 'wporg_themes_glotpress_mark_as_active_on_publish' ); 1133 1152 1134 1153 /**
Note: See TracChangeset
for help on using the changeset viewer.