Title: _post_format_get_terms
Published: April 25, 2014
Last modified: May 20, 2026

---

# _post_format_get_terms( array $terms, string|array $taxonomies, array $args ): array

## In this article

 * [Parameters](https://developer.wordpress.org/reference/functions/_post_format_get_terms/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/functions/_post_format_get_terms/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/functions/_post_format_get_terms/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/functions/_post_format_get_terms/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/_post_format_get_terms/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/functions/_post_format_get_terms/?output_format=md#wp--skip-link--target)

This function’s access is marked private. This means it is not intended for use 
by plugin or theme developers, only by core. It is listed here for completeness.

Remove the post format prefix from the name property of the term objects created
by [get_terms()](https://developer.wordpress.org/reference/functions/get_terms/).

## 󠀁[Parameters](https://developer.wordpress.org/reference/functions/_post_format_get_terms/?output_format=md#parameters)󠁿

 `$terms`arrayrequired

`$taxonomies`string|arrayrequired

`$args`arrayrequired

## 󠀁[Return](https://developer.wordpress.org/reference/functions/_post_format_get_terms/?output_format=md#return)󠁿

 array

## 󠀁[Source](https://developer.wordpress.org/reference/functions/_post_format_get_terms/?output_format=md#source)󠁿

    ```php
    function _post_format_get_terms( $terms, $taxonomies, $args ) {
    	if ( in_array( 'post_format', (array) $taxonomies, true ) ) {
    		if ( isset( $args['fields'] ) && 'names' === $args['fields'] ) {
    			foreach ( $terms as $order => $name ) {
    				$terms[ $order ] = get_post_format_string( str_replace( 'post-format-', '', $name ) );
    			}
    		} else {
    			foreach ( (array) $terms as $order => $term ) {
    				if ( isset( $term->taxonomy ) && 'post_format' === $term->taxonomy ) {
    					$terms[ $order ]->name = get_post_format_string( str_replace( 'post-format-', '', $term->slug ) );
    				}
    			}
    		}
    	}
    	return $terms;
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/post-formats.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-includes/post-formats.php#L234)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/post-formats.php#L234-L249)

## 󠀁[Related](https://developer.wordpress.org/reference/functions/_post_format_get_terms/?output_format=md#related)󠁿

| Uses | Description | 
| [get_post_format_string()](https://developer.wordpress.org/reference/functions/get_post_format_string/)`wp-includes/post-formats.php` |

Returns a pretty, translated version of a post format slug

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/_post_format_get_terms/?output_format=md#changelog)󠁿

| Version | Description | 
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2F_post_format_get_terms%2F)
before being able to contribute a note or feedback.