Ticket #43435: 43435.5.diff
File 43435.5.diff, 4.3 KB (added by , 7 years ago) |
---|
-
src/wp-admin/privacy.php
60 60 } 61 61 } 62 62 63 // If a privacy policy page ID is available, make sure the page actually exists. If not, display a warning63 // If a privacy policy page ID is available, make sure the page actually exists. If not, display an error. 64 64 $privacy_policy_page_exists = false; 65 65 $privacy_policy_page_id = (int) get_option( 'wp_page_for_privacy_policy' ); 66 66 … … 71 71 'page_for_privacy_policy', 72 72 'page_for_privacy_policy', 73 73 __( 'The currently selected privacy policy page does not exist. Please create or select new page.' ), 74 ' warning'74 'error' 75 75 ); 76 76 } else { 77 77 if ( 'trash' === $privacy_policy_page->post_status ) { … … 110 110 <h1><?php echo esc_html( $title ); ?></h1> 111 111 <?php settings_errors(); ?> 112 112 113 <h2 class="title"><?php _e( 'Privacy policy page' ); ?></h2> 114 <table class="form-table"> 115 <?php 113 <h2><?php _e( 'Privacy policy page' ); ?></h2> 116 114 117 if ( $privacy_policy_page_exists ) { 118 $edit_href = add_query_arg( 119 array( 120 'post' => $privacy_policy_page_id, 121 'action' => 'edit', 122 ), 123 admin_url( 'post.php' ) 124 ); 125 $view_href = get_permalink( $privacy_policy_page_id ); 115 <?php 116 if ( $privacy_policy_page_exists ) { 117 $edit_href = add_query_arg( 118 array( 119 'post' => $privacy_policy_page_id, 120 'action' => 'edit', 121 ), 122 admin_url( 'post.php' ) 123 ); 124 $view_href = get_permalink( $privacy_policy_page_id ); 126 125 127 ?> 128 <tr> 129 <th colspan="2"> 130 <?php 131 printf( 132 __( '<a href="%1$s">Edit</a> or <a href="%2$s">view</a> your privacy policy.' ), 133 $edit_href, 134 $view_href 135 ); 136 ?> 137 </th> 138 </tr> 139 <?php 140 } 126 ?> 127 <div class="notice notice-info inline"> 128 <p> 129 <?php 130 printf( 131 __( '<a href="%1$s">Edit</a> or <a href="%2$s">view</a> your privacy policy.' ), 132 $edit_href, 133 $view_href 134 ); 135 ?> 136 </p> 137 </div> 138 <?php 139 } 140 ?> 141 141 142 ?>142 <table class="form-table"> 143 143 <tr> 144 144 <th scope="row"> 145 145 <?php 146 $select_page_label = __( 'Select an existing privacy policy page' ); 146 147 147 if ( $privacy_policy_page_exists ) { 148 _e( 'Select another page for your privacy policy' ); 149 } else { 150 _e( 'Select an existing privacy policy page' ); 151 } 152 148 if ( $privacy_policy_page_exists ) { 149 $select_page_label = __( 'Select another page for your privacy policy' ); 150 } 153 151 ?> 152 <label for="page_for_privacy_policy"><?php echo esc_html( $select_page_label ); ?></label> 154 153 </th> 155 154 <td id="front-static-pages"> 156 155 <form method="post" action=""> 157 156 <?php wp_nonce_field( 'set-privacy-page' ); ?> 158 157 <input type="hidden" name="action" value="set-privacy-page" /> 159 <fieldset> 160 <legend class="screen-reader-text"><span><?php _e( 'Select your privacy policy page.' ); ?></span></legend> 161 <label for="page_for_privacy_policy"> 162 <?php wp_dropdown_pages( 163 array( 164 'name' => 'page_for_privacy_policy', 165 'show_option_none' => __( '— Select —' ), 166 'option_none_value' => '0', 167 'selected' => $privacy_policy_page_id, 168 'post_status' => array( 'draft', 'publish' ), 169 ) 170 ); 171 ?> 172 </label> 173 </fieldset> 174 <?php submit_button( __( 'Set Page' ) ); ?> 158 <?php wp_dropdown_pages( 159 array( 160 'name' => 'page_for_privacy_policy', 161 'show_option_none' => __( '— Select —' ), 162 'option_none_value' => '0', 163 'selected' => $privacy_policy_page_id, 164 'post_status' => array( 'draft', 'publish' ), 165 ) 166 ); 167 ?> 168 <?php submit_button( __( 'Set Page' ), 'primary', 'submit', true, array( 'id' => 'set-page' ) ); ?> 175 169 </form> 176 170 </td> 177 171 </tr> … … 185 179 <form method="post" action=""> 186 180 <input type="hidden" name="action" value="create-privacy-page" /> 187 181 <?php wp_nonce_field( 'create-privacy-page' ); ?> 188 <?php submit_button( __( 'Create Page' ) ); ?>182 <?php submit_button( __( 'Create Page' ), 'primary', 'submit', true, array( 'id' => 'create-page' ) ); ?> 189 183 </form> 190 184 </td> 191 185 </tr>