Changeset 24388 for trunk/wp-admin/includes/screen.php
- Timestamp:
- 05/30/2013 09:33:46 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/screen.php
r24282 r24388 964 964 echo '<input type="checkbox" id="wp_welcome_panel-hide"' . checked( (bool) $welcome_checked, true, false ) . ' />'; 965 965 echo _x( 'Welcome', 'Welcome panel' ) . "</label>\n"; 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 shown969 // 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 else974 $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;991 }992 993 echo '<label for="show_post_format_ui">';994 echo '<input type="checkbox" id="show_post_format_ui"' . checked( $show_post_format_ui, true, false ) . ' />';995 echo __( 'Post Formats' ) . "</label>\n";996 966 } 997 967 ?>
Note: See TracChangeset
for help on using the changeset viewer.