| 1 |
<?php |
| 2 |
|
| 3 |
// ########################## |
| 4 |
// ADD BLOCKS |
| 5 |
// ########################## |
| 6 |
add_action('acf/init', 'my_acf_blocks_init'); |
| 7 |
function my_acf_blocks_init() { |
| 8 |
if( function_exists('acf_register_block_type') ) { |
| 9 |
// Register a slider block. |
| 10 |
acf_register_block_type(array( |
| 11 |
'name' => 'A lire aussi (Actualités) )', |
| 12 |
'title' => __('A lire aussi (Actualités)'), |
| 13 |
'description' => __('Ajouter une liste d\'actualités a lire aussi.'), |
| 14 |
'render_template' => '/blocks/read-actualites.php', |
| 15 |
'category' => 'readmore', |
| 16 |
'mode' => 'edit', |
| 17 |
)); |
| 18 |
// include_once( get_template_directory() .'/inc/acf-block-read-actualites.php'); |
| 19 |
|
| 20 |
// Register a slider block. |
| 21 |
acf_register_block_type(array( |
| 22 |
'name' => 'A lire aussi (Agenda) )', |
| 23 |
'title' => __('A lire aussi (Agenda)'), |
| 24 |
'description' => __('Ajouter une liste d\'évènements a lire aussi.'), |
| 25 |
'render_template' => '/blocks/read-agenda.php', |
| 26 |
'category' => 'readmore', |
| 27 |
'mode' => 'edit', |
| 28 |
)); |
| 29 |
// include_once( get_template_directory() .'/inc/acf-block-read-agenda.php'); |
| 30 |
|
| 31 |
// Register a slider block. |
| 32 |
acf_register_block_type(array( |
| 33 |
'name' => 'A lire aussi (Annuaire) )', |
| 34 |
'title' => __('A lire aussi (Annuaire)'), |
| 35 |
'description' => __('Ajouter une liste de l\'annuaire a lire aussi.'), |
| 36 |
'render_template' => '/blocks/read-agents.php', |
| 37 |
'category' => 'readmore', |
| 38 |
'mode' => 'edit', |
| 39 |
)); |
| 40 |
// include_once( get_template_directory() .'/inc/acf-block-read-annuaire.php'); |
| 41 |
|
| 42 |
acf_register_block_type(array( |
| 43 |
'name' => 'A lire aussi (Témoignages) )', |
| 44 |
'title' => __('A lire aussi (Témoignages)'), |
| 45 |
'description' => __('Ajouter une liste de témoignages a lire aussi.'), |
| 46 |
'render_template' => '/blocks/read-portraits.php', |
| 47 |
'category' => 'readmore', |
| 48 |
'mode' => 'edit', |
| 49 |
)); |
| 50 |
// include_once( get_template_directory() .'/inc/acf-block-read-temoignages.php'); |
| 51 |
|
| 52 |
acf_register_block_type(array( |
| 53 |
'name' => 'A lire aussi (Projets) )', |
| 54 |
'title' => __('A lire aussi (Projets)'), |
| 55 |
'description' => __('Ajouter une liste de projets a lire aussi.'), |
| 56 |
'render_template' => '/blocks/read-projets.php', |
| 57 |
'category' => 'readmore', |
| 58 |
'mode' => 'edit', |
| 59 |
)); |
| 60 |
// include_once( get_template_directory() .'/inc/acf-block-read-projets.php'); |
| 61 |
|
| 62 |
acf_register_block_type(array( |
| 63 |
'name' => 'A lire aussi (Formations) )', |
| 64 |
'title' => __('A lire aussi (Formations)'), |
| 65 |
'description' => __('Ajouter une liste de formations a lire aussi.'), |
| 66 |
'render_template' => '/blocks/read-formations.php', |
| 67 |
'category' => 'readmore', |
| 68 |
'mode' => 'edit', |
| 69 |
)); |
| 70 |
// include_once( get_template_directory() .'/inc/acf-block-read-formations.php'); |
| 71 |
|
| 72 |
} |
| 73 |
} |
| 74 |
|
| 75 |
|
| 76 |
return; |
| 77 |
|
| 78 |
/* |
| 79 |
|
| 80 |
add_action('init', 'test_wpdeepl_taxonomy' ); |
| 81 |
function test_wpdeepl_taxonomy() { |
| 82 |
|
| 83 |
$labels = array( |
| 84 |
'name' => _x( 'Formations', 'taxonomy general name', 'textdomain' ), |
| 85 |
'singular_name' => _x( 'Formation', 'taxonomy singular name', 'textdomain' ), |
| 86 |
'search_items' => __( 'Search Formations', 'textdomain' ), |
| 87 |
'all_items' => __( 'All Formations', 'textdomain' ), |
| 88 |
'parent_item' => __( 'Parent Formation', 'textdomain' ), |
| 89 |
'parent_item_colon' => __( 'Parent Formation:', 'textdomain' ), |
| 90 |
'edit_item' => __( 'Edit Formation', 'textdomain' ), |
| 91 |
'update_item' => __( 'Update Formation', 'textdomain' ), |
| 92 |
'add_new_item' => __( 'Add New Formation', 'textdomain' ), |
| 93 |
'new_item_name' => __( 'New Formation Name', 'textdomain' ), |
| 94 |
'menu_name' => __( 'Formation', 'textdomain' ), |
| 95 |
); |
| 96 |
|
| 97 |
$args = array( |
| 98 |
'labels' => $labels, |
| 99 |
'public' => true, |
| 100 |
'rewrite' => false, |
| 101 |
'hierarchical' => false, |
| 102 |
'show_ui' => true, |
| 103 |
'show_admin_column' => true, |
| 104 |
); |
| 105 |
register_taxonomy( 'formation','post', $args ); |
| 106 |
|
| 107 |
} |
| 108 |
|
| 109 |
*/ |