functions.php 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. <?php
  2. /*
  3. |--------------------------------------------------------------------------
  4. | Register The Auto Loader
  5. |--------------------------------------------------------------------------
  6. |
  7. | Composer provides a convenient, automatically generated class loader for
  8. | our theme. We will simply require it into the script here so that we
  9. | don't have to worry about manually loading any of our classes later on.
  10. |
  11. */
  12. if (! file_exists($composer = __DIR__.'/vendor/autoload.php')) {
  13. wp_die(__('Error locating autoloader. Please run <code>composer install</code>.', 'sage'));
  14. }
  15. require $composer;
  16. /*
  17. |--------------------------------------------------------------------------
  18. | Register The Bootloader
  19. |--------------------------------------------------------------------------
  20. |
  21. | The first thing we will do is schedule a new Acorn application container
  22. | to boot when WordPress is finished loading the theme. The application
  23. | serves as the "glue" for all the components of Laravel and is
  24. | the IoC container for the system binding all of the various parts.
  25. |
  26. */
  27. if (! function_exists('\Roots\bootloader')) {
  28. wp_die(
  29. __('You need to install Acorn to use this theme.', 'sage'),
  30. '',
  31. [
  32. 'link_url' => 'https://roots.io/acorn/docs/installation/',
  33. 'link_text' => __('Acorn Docs: Installation', 'sage'),
  34. ]
  35. );
  36. }
  37. \Roots\bootloader()->boot();
  38. /*
  39. |--------------------------------------------------------------------------
  40. | Register Sage Theme Files
  41. |--------------------------------------------------------------------------
  42. |
  43. | Out of the box, Sage ships with categorically named theme files
  44. | containing common functionality and setup to be bootstrapped with your
  45. | theme. Simply add (or remove) files from the array below to change what
  46. | is registered alongside Sage.
  47. |
  48. */
  49. collect(['setup', 'filters'])
  50. ->each(function ($file) {
  51. if (! locate_template($file = "app/{$file}.php", true, true)) {
  52. wp_die(
  53. /* translators: %s is replaced with the relative file path */
  54. sprintf(__('Error locating <code>%s</code> for inclusion.', 'sage'), $file)
  55. );
  56. }
  57. });
  58. //ajout des champs personnalisés Minutage et Images; pour les afficher rdv dans le fichier content-single
  59. //le faire qu'une suele fois et après mettre en commentaire
  60. // function ajout_champs() {
  61. // add_post_meta(get_the_ID(), 'Index', true);
  62. // add_post_meta(get_the_ID(), 'Minutage', true);
  63. // add_post_meta(get_the_ID(), 'Images', true);
  64. // add_post_meta(get_the_ID(), 'BandeSon', true);
  65. // add_post_meta(get_the_ID(), 'Ecrits', true);
  66. // add_post_meta(get_the_ID(), 'VoixOffIn', true);
  67. // add_post_meta(get_the_ID(), 'isMainPart', true);
  68. // add_post_meta(get_the_ID(), 'isSubPart', true);
  69. // }
  70. // add_action('init', 'ajout_champs');
  71. function cacher_bloc_head_admin() {
  72. // Cache le bloc head du plugin de PublicPress
  73. echo '<style>.pp-version-notice-bold-purple { display: none; }</style>';
  74. echo '<style>.notice-warning { display: none; }</style>';
  75. }
  76. add_action('admin_head', 'cacher_bloc_head_admin');
  77. function cacher_bloc_foot_admin() {
  78. // Cache le bloc foot du plugin de PublicPress
  79. echo '<style>.pp-rating { display: none; }</style>';
  80. echo '<style>.pp-pressshack-logo { display: none; }</style>';
  81. echo '<style> footer nav{ display: none; }</style>';
  82. echo '<style> ul.subsubsub li:nth-child(1) a { display: none;}</style>';
  83. }
  84. add_action('admin_footer', 'cacher_bloc_foot_admin');
  85. // function supprimer_tous_les_articles() {
  86. // $args = array(
  87. // 'post_type' => 'post',
  88. // 'posts_per_page' => -1,
  89. // );
  90. // $posts = get_posts($args);
  91. // foreach ($posts as $post) {
  92. // wp_delete_post($post->ID, true);
  93. // }
  94. // }
  95. // add_action('init', 'supprimer_tous_les_articles');