Changeset 8262
- Timestamp:
- 02/16/2019 12:57:49 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wcpt/wcpt-event/class-event-admin.php
r8235 r8262 251 251 252 252 /** 253 * Filter: Set the locale to en_US. 254 * 255 * For some purposes, such as internal logging, strings that would normally be translated to the 256 * current user's locale should be in English, so that other users who may not share the same 257 * locale can read them. 258 * 259 * @return string 260 */ 261 public function set_locale_to_en_US() { 262 return 'en_US'; 263 } 264 265 /** 253 266 * Log when the post status changes 254 267 * … … 265 278 return; 266 279 } 280 281 // Ensure status labels are in English. 282 add_filter( 'locale', array( $this, 'set_locale_to_en_US' ) ); 267 283 268 284 $old_status = get_post_status_object( $old_status ); … … 278 294 ) 279 295 ); 296 280 297 // Encoding $post_type and status_change meta ID in key so that we can fetch it if needed while simultaneously be able to have a where clause on value. 281 298 // Because of the way MySQL works, it will still be able to use index on meta_key when searching, as long as we are querying just the prefix. … … 283 300 add_post_meta( $post->ID, "_status_change_log_$post->post_type $log_id", time() ); 284 301 } 302 303 // Remove the temporary locale change. 304 remove_filter( 'locale', array( $this, 'set_locale_to_en_US' ) ); 285 305 } 286 306
Note: See TracChangeset
for help on using the changeset viewer.