Ejemplo n.º 1
0
 function testPostMetaFieldFilter()
 {
     $post_id = $this->factory->post->create();
     update_post_meta($post_id, 'Frank', 'Drebin');
     $tp = new TimberPost($post_id);
     add_filter('timber_post_get_meta_field', array($this, 'filter_timber_post_get_meta_field'), 10, 4);
     $this->assertEquals('Drebin', $tp->meta('Frank'));
     remove_filter('timber_post_get_meta_field', array($this, 'filter_timber_post_get_meta_field'));
 }
Ejemplo n.º 2
0
 public function meta($field_name = null)
 {
     return $this->post->meta($field_name);
 }