Changeset 24282 for trunk/wp-admin/includes/screen.php
- Timestamp:
- 05/17/2013 03:12:50 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/screen.php
r24092 r24282 937 937 $columns = get_column_headers( $this ); 938 938 $hidden = get_hidden_columns( $this ); 939 $post = get_post(); 939 940 940 941 ?> … … 963 964 echo '<input type="checkbox" id="wp_welcome_panel-hide"' . checked( (bool) $welcome_checked, true, false ) . ' />'; 964 965 echo _x( 'Welcome', 'Welcome panel' ) . "</label>\n"; 965 } elseif ( 'post' == $this->base && post_type_supports( $this->post_type, 'post-formats' ) && apply_filters( 'enable_post_format_ui', true, $GLOBALS['post'] ) ) { 966 $user_wants = get_user_option( 'post_formats_' . $this->post_type ); 967 if ( false !== $user_wants ) { 968 // User wants what user gets. 969 $show_post_format_ui = (bool) $user_wants; 970 } else { 971 // UI is shown when the theme supports formats, or if the site has formats assigned to posts. 972 $show_post_format_ui = current_theme_supports( 'post-formats' ) || get_terms( 'post_format', array( 'number' => 1 ) ); 966 } elseif ( 'post' == $this->base && post_type_supports( $this->post_type, 'post-formats' ) && apply_filters( 'enable_post_format_ui', true, $post ) ) { 967 968 // If the user has explicitly set a screen option, use it, otherwise the UI is shown 969 // when the theme supports formats, or if the site has formats assigned to posts. 970 $post_format_user_option = get_user_option( 'post_formats_' . $post->post_type ); 971 if ( false !== $post_format_user_option ) 972 $show_post_format_ui = (bool) $post_format_user_option; 973 else 974 $show_post_format_ui = current_theme_supports( 'post-formats' ) || (bool) get_terms( 'post_format', array( 'number' => 1 ) ); 975 976 if ( ! $show_post_format_ui && 'auto-draft' != $post->post_status ) { 977 $meta = get_post_format_meta( $post->ID ); 978 $format_meta_keys = array( 979 'link' => array( 'linkurl' ), 980 'image' => array( 'url', 'image' ), 981 'quote' => array( 'quote_source_name', 'quote_source_url' ), 982 'video' => array( 'video_embed' ), 983 'audio' => array( 'audio_embed' ), 984 ); 985 986 // If there's any structured post format data, enforce the UI display. 987 $format_meta_keys = isset( $format_meta_keys[ get_post_format() ] ) ? $format_meta_keys[ get_post_format() ] : array(); 988 foreach ( $format_meta_keys as $key ) 989 if ( ! empty( $meta[ $key ] ) ) 990 $show_post_format_ui = true; 973 991 } 992 974 993 echo '<label for="show_post_format_ui">'; 975 994 echo '<input type="checkbox" id="show_post_format_ui"' . checked( $show_post_format_ui, true, false ) . ' />';
Note: See TracChangeset
for help on using the changeset viewer.