Changeset 24388 for trunk/wp-admin/admin-header.php
- Timestamp:
- 05/30/2013 09:33:46 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/admin-header.php
r24373 r24388 96 96 97 97 $admin_body_class .= ' wp-format-' . $post_format; 98 99 $show_post_format_ui = false;100 101 if ( apply_filters( 'enable_post_format_ui', true, $post ) ) {102 103 // If the user has explicitly set a screen option, use it, otherwise the UI is shown104 // when the theme supports formats, or if the site has formats assigned to posts.105 $post_format_user_option = get_user_option( 'post_formats_' . $post->post_type );106 if ( false !== $post_format_user_option )107 $show_post_format_ui = (bool) $post_format_user_option;108 else109 $show_post_format_ui = current_theme_supports( 'post-formats' ) || (bool) get_terms( 'post_format', array( 'number' => 1 ) );110 111 if ( ! $show_post_format_ui ) {112 $meta = get_post_format_meta( $post->ID );113 $format_meta_keys = array(114 'link' => array( 'linkurl' ),115 'image' => array( 'url', 'image' ),116 'quote' => array( 'quote_source_name', 'quote_source_url' ),117 'video' => array( 'video_embed' ),118 'audio' => array( 'audio_embed' ),119 );120 121 // If there's any structured post format data, enforce the UI display.122 $format_meta_keys = isset( $format_meta_keys[ get_post_format() ] ) ? $format_meta_keys[ get_post_format() ] : array();123 foreach ( $format_meta_keys as $key )124 if ( ! empty( $meta[ $key ] ) )125 $show_post_format_ui = true;126 }127 }128 129 if ( $show_post_format_ui )130 $admin_body_class .= ' wp-post-format-show-ui';131 98 } 132 99
Note: See TracChangeset
for help on using the changeset viewer.