term-color-config.php
67 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Load modules |
| 4 | * |
| 5 | * @package vk_blocks |
| 6 | */ |
| 7 | |
| 8 | /** |
| 9 | * Term color taxonomies custom |
| 10 | * |
| 11 | * 色選択機能をつける対象のタームの指定 |
| 12 | * � |
| 13 | � |
| 14 | � |
| 15 | � |
| 16 | � |
| 17 | � |
| 18 | 関数のprefixは固有のものに変更する事 � |
| 19 | � |
| 20 | � |
| 21 | � |
| 22 | � |
| 23 | � |
| 24 | |
| 25 | * |
| 26 | * @param array $taxonomies List of taxonomies. |
| 27 | * @return array |
| 28 | */ |
| 29 | function vk_blocks_term_color_taxonomies_custom( $taxonomies ) { |
| 30 | // 存在するtaxonomiesを取得 |
| 31 | $args = array( 'show_ui' => true ); |
| 32 | $get_taxonomies = get_taxonomies( $args ); |
| 33 | // term color を有効化する taxonomy の� |
| 34 | �列に追加 |
| 35 | foreach ( $get_taxonomies as $key => $value ) { |
| 36 | $taxonomies[] = $value; |
| 37 | } |
| 38 | return $taxonomies; |
| 39 | } |
| 40 | add_filter( 'term_color_taxonomies_custom', 'vk_blocks_term_color_taxonomies_custom' ); |
| 41 | |
| 42 | /** |
| 43 | * Load term color class |
| 44 | * |
| 45 | * 読み込みタイミングを init にしておかないと |
| 46 | * init で作成されたカスタム分類に対応できない |
| 47 | * � |
| 48 | � |
| 49 | � |
| 50 | � |
| 51 | � |
| 52 | � |
| 53 | 関数のprefixは固有のものに変更する事 � |
| 54 | � |
| 55 | � |
| 56 | � |
| 57 | � |
| 58 | � |
| 59 | |
| 60 | * |
| 61 | * @return void |
| 62 | */ |
| 63 | function vk_blocks_load_term_color() { |
| 64 | \VektorInc\VK_Term_Color\VkTermColor::init(); |
| 65 | } |
| 66 | add_action( 'init', 'vk_blocks_load_term_color' ); |
| 67 |