Ticket #44100: 44100.3.diff
File 44100.3.diff, 1.4 KB (added by , 7 years ago) |
---|
-
src/wp-admin/privacy.php
13 13 wp_die( __( 'Sorry, you are not allowed to manage privacy on this site.' ) ); 14 14 } 15 15 16 /** 17 * Appends '(Draft)' to draft page titles in the privacy page dropdown 18 * so that unpublished content is obvious. 19 * 20 * @since 4.9.7 21 * @access private 22 * 23 * @param string $title Page title. 24 * @param WP_Post $page Page data object. 25 * 26 * @return string Page title. 27 */ 28 function _wp_privacy_settings_filter_draft_page_titles( $title, $page ) { 29 if ( 'draft' === $page->post_status ) { 30 /* translators: %s: Page Title */ 31 $title = sprintf( __( '%s (Draft)' ), $title ); 32 } 33 34 return $title; 35 } 36 16 37 $action = isset( $_POST['action'] ) ? $_POST['action'] : ''; 17 38 18 39 if ( ! empty( $action ) ) { … … 211 232 </label> 212 233 <input type="hidden" name="action" value="set-privacy-page" /> 213 234 <?php 235 add_filter( 'list_pages', '_wp_privacy_settings_filter_draft_page_titles', 10, 2 ); 214 236 wp_dropdown_pages( 215 237 array( 216 238 'name' => 'page_for_privacy_policy', … … 220 242 'post_status' => array( 'draft', 'publish' ), 221 243 ) 222 244 ); 245 remove_filter( 'list_pages', '_wp_privacy_settings_filter_draft_page_titles', 10, 2 ); 223 246 224 247 wp_nonce_field( 'set-privacy-page' ); 225 248