Slider Revolution WP
09.27.2016
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
add_filter('essgrid_post_meta_handle', 'eg_add_post_option'); add_filter('essgrid_post_meta_content', 'eg_add_post_content', 10, 4); function eg_add_post_option($post_options){ // where 'author_id' is the attribute of the data to pull in $post_options['author_id'] = array('name' => 'Author ID'); return $post_options; } function eg_add_post_content($meta_value, $meta, $post_id, $post){ // where 'author_id' is the attribute of the data to pull in if($meta === 'author_id'){ $post_author_id = get_post_field( 'post_author', $post_id ); // return the post data value, and wrap it in any HTML you want return '<div class="author-id">Author ID = '.$post_author_id.'</div>'; } return $meta_value; } |