_post_format_wp_get_object_terms

Remove the post format prefix from the name property of the term objects created by wp_get_object_terms().

Description

(array) _post_format_wp_get_object_terms( (array) $terms ); 

Returns (array)

Parameters (1)

0. $terms (array)
The terms.

Usage

  1. if ( !function_exists( '_post_format_wp_get_object_terms' ) ) { 
  2. require_once ABSPATH . WPINC . '/post-formats.php'; 
  3.  
  4. // The terms. 
  5. $terms = array(); 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = _post_format_wp_get_object_terms($terms); 
  9.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/post-formats.php  
  1. function _post_format_wp_get_object_terms( $terms ) { 
  2. foreach ( (array) $terms as $order => $term ) { 
  3. if ( isset( $term->taxonomy ) && 'post_format' == $term->taxonomy ) { 
  4. $terms[$order]->name = get_post_format_string( str_replace( 'post-format-', '', $term->slug ) ); 
  5. return $terms;