Changeset 12845
- Timestamp:
- 08/17/2023 04:10:57 AM (20 months ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/admin-edit.php
r12601 r12845 193 193 } 194 194 elseif ( current_user_can( 'reinstate_theme', $post->ID ) && 'suspend' == $post->post_status ) { 195 $links[] = sprintf( '<a class="submit-reinstate_theme" title="%1$s" href="%2$s">%3$s</a>', esc_attr__( ' Suspendthis item', 'wporg-themes' ), esc_url( wporg_themes_get_reinstate_url( $post ) ), __( 'Reinstate', 'wporg-themes' ) );195 $links[] = sprintf( '<a class="submit-reinstate_theme" title="%1$s" href="%2$s">%3$s</a>', esc_attr__( 'Reinstate this item', 'wporg-themes' ), esc_url( wporg_themes_get_reinstate_url( $post ) ), __( 'Reinstate', 'wporg-themes' ) ); 196 196 } 197 197 … … 260 260 'post_status' => 'suspend', 261 261 ) ); 262 263 wporg_themes_remove_wpthemescom( $post->post_name );264 262 265 263 wp_redirect( add_query_arg( 'suspended', 1, remove_query_arg( array( 'trashed', 'untrashed', 'deleted', 'ids', 'reinstated', 'delisted', 'relisted' ), wp_get_referer() ) ) ); … … 404 402 } 405 403 add_filter( 'admin_action_relist', 'wporg_themes_relist_theme' ); 406 407 /**408 * Remove themes from wp-themes.com upon theme status moving to draft.409 *410 * @param WP_Post $post411 */412 function wporg_themes_remove_draft_themes_from_wpthemescom( $post ) {413 if ( 'repopackage' === $post->post_type ) {414 wporg_themes_remove_wpthemescom( $post->post_name );415 }416 }417 add_action( 'publish_to_draft', 'wporg_themes_remove_draft_themes_from_wpthemescom' );418 404 419 405 /** -
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.