PluginProbe
Themify Builder / trunk
Themify Builder vtrunk
7.8.1 7.8.0 7.7.9 7.7.8 7.7.7 7.7.6 7.7.5 7.7.4 7.7.3 7.7.2 trunk 7.6.0 7.6.1 7.6.2 7.6.3 7.6.4 7.6.5 7.6.6 7.6.7 7.6.8 7.6.9 7.7.0 7.7.1
themify-builder / themify / class-tf-term-image.php

class-tf-term-image.php in Themify Builder trunk, at themify/class-tf-term-image.php

36 lines 1.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Term Cover Image
4 */
5
6 final class Themify_Term_Images {
7
8 public static function run() {
9 add_action( 'admin_init', array( __CLASS__, 'admin_init' ), 100 );
10 }
11
12 /**
13 * Add options to all taxonomy terms that have archives
14 */
15 public static function admin_init() {
16 $taxonomies = get_taxonomies( array( 'public' => true ) );
17 foreach ( $taxonomies as $tax ) {
18 add_filter( "themify_metabox/taxonomy/{$tax}/fields", array( __CLASS__, 'fields' ) );
19 }
20 }
21
22 public static function fields( $fields ) {
23 $options = array(
24 array(
25 'name' => 'tbp_cover',
26 'title' => __( 'Themify Cover Image', 'themify' ),
27 'description' => __( 'This image can be used in various Themify templates, like in Builder Pro archive templates.', 'themify' ),
28 'type' => 'image',
29 'meta' => array()
30 ),
31 );
32
33 return array_merge( $fields, $options );
34 }
35 }
36 Themify_Term_Images::run();