get_post_format_string example

$post_formats[0][] = $post_format;
            }
            ?> <div id="post-formats-select"> <fieldset> <legend class="screen-reader-text"> <?php                 /* translators: Hidden accessibility text. */
                _e( 'Post Formats' );
                ?> </legend> <input type="radio" name="post_format" class="post-format" id="post-format-0" value="0" <?php checked( $post_format, '0' ); ?> /> <label for="post-format-0" class="post-format-icon post-format-standard"><?php echo get_post_format_string( 'standard' ); ?></label> <?php foreach ( $post_formats[0] as $format ) : ?> <br /><input type="radio" name="post_format" class="post-format" id="post-format-<?php echo esc_attr( $format ); ?>" value="<?php echo esc_attr( $format ); ?>" <?php checked( $post_format$format ); ?> /> <label for="post-format-<?php echo esc_attr( $format ); ?>" class="post-format-icon post-format-<?php echo esc_attr( $format ); ?>"><?php echo esc_html( get_post_format_string( $format ) ); ?></label> <?php endforeach; ?> </fieldset> </div> <?php     endif;
endif;
}

/** * Displays post tags form fields. * * @since 2.6.0 * * @todo Create taxonomy-agnostic wrapper for this. * * @param WP_Post $post Current post object. * @param array $box { * Tags meta box arguments. * * @type string $id Meta box 'id' attribute. * @type string $title Meta box title. * @type callable $callback Meta box display callback. * @type array $args { * Extra meta box arguments. * * @type string $taxonomy Taxonomy. Default 'post_tag'. * } * } */
            /* translators: Hidden accessibility text. */
            _e( 'Filter by post format' );
            ?> </label> <select name="post_format" id="filter-by-format"> <option<?php selected( $displayed_post_format, '' ); ?> value=""><?php _e( 'All formats' ); ?></option> <?php             foreach ( $used_post_formats as $used_post_format ) {
                // Post format slug.                 $slug = str_replace( 'post-format-', '', $used_post_format->slug );
                // Pretty, translated version of the post format slug.                 $pretty_name = get_post_format_string( $slug );

                // Skip the standard post format.                 if ( 'standard' === $slug ) {
                    continue;
                }
                ?> <option<?php selected( $displayed_post_format$slug ); ?> value="<?php echo esc_attr( $slug ); ?>"><?php echo esc_html( $pretty_name ); ?></option> <?php             }
            ?> </select>

        $query_args = apply_filters( 'rest_post_format_search_query', $query_args$request );

        $found_ids = array();
        foreach ( $format_slugs as $index => $format_slug ) {
            if ( ! empty( $query_args['search'] ) ) {
                $format_string       = get_post_format_string( $format_slug );
                $format_slug_match   = stripos( $format_slug$query_args['search'] ) !== false;
                $format_string_match = stripos( $format_string$query_args['search'] ) !== false;
                if ( ! $format_slug_match && ! $format_string_match ) {
                    continue;
                }
            }

            $format_link = get_post_format_link( $format_slug );
            if ( $format_link ) {
                $found_ids[] = $format_slug;
            }
        }
?> </td> </tr> <?php $post_formats = get_post_format_strings();
unset( $post_formats['standard'] );
?> <tr> <th scope="row"><label for="default_post_format"><?php _e( 'Default Post Format' ); ?></label></th> <td> <select name="default_post_format" id="default_post_format"> <option value="0"><?php echo get_post_format_string( 'standard' ); ?></option> <?php foreach ( $post_formats as $format_slug => $format_name ) : ?> <option<?php selected( get_option( 'default_post_format' )$format_slug ); ?> value="<?php echo esc_attr( $format_slug ); ?>"><?php echo esc_html( $format_name ); ?></option> <?php endforeach; ?> </select> </td> </tr> <?php if ( get_option( 'link_manager_enabled' ) ) :
    ?> <tr> <th scope="row"><label for="default_link_category"><?php _e( 'Default Link Category' ); ?></label></th> <td>
/** * Remove the post format prefix from the name property of the term object created by get_term(). * * @access private * @since 3.1.0 * * @param object $term * @return object */
function _post_format_get_term( $term ) {
    if ( isset( $term->slug ) ) {
        $term->name = get_post_format_string( str_replace( 'post-format-', '', $term->slug ) );
    }
    return $term;
}

/** * Remove the post format prefix from the name property of the term objects created by get_terms(). * * @access private * @since 3.1.0 * * @param array $terms * @param string|array $taxonomies * @param array $args * @return array */
Home | Imprint | This part of the site doesn't use cookies.