Make WordPress Core


Ignore:
Timestamp:
02/18/2013 07:11:24 PM (11 years ago)
Author:
helen
Message:

Edit screen UI for post formats: a first run for functionality.

  • Adds a very basic tabbed interface for selecting a post format (requires JS).
  • Extra fields, which are post meta, are shown/hidden based on the selected format.
  • Introduce a helper function for retrieving formats-specific metadata: get_post_format_meta().
  • Image selection uses the media modal, although without filtering or from URL support at the moment.

props rachelbaker, wonderboymusic, aaroncampbell, helen. see #19570.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/post.php

    r23420 r23449  
    19521952
    19531953/**
     1954 * Retrieve post format metadata for a post
     1955 *
     1956 * @since 3.6.0
     1957 *
     1958 * @param int $post_id
     1959 * @return null
     1960 */
     1961function get_post_format_meta( $post_id = 0 ) {
     1962    $values = array(
     1963        'quote'        => '',
     1964        'quote_source' => '',
     1965        'image'        => '',
     1966        'url'          => '',
     1967        'gallery'      => '',
     1968        'media'        => '',
     1969    );
     1970
     1971    foreach ( $values as $key => $value )
     1972        $values[$key] = get_post_meta( $post_id, '_wp_format_' . $key, true );
     1973
     1974    return $values;
     1975}
     1976
     1977/**
    19541978 * Check if post is sticky.
    19551979 *
Note: See TracChangeset for help on using the changeset viewer.