ru-se.com

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

wp-5.8.php (780B)


      1 <?php
      2 
      3 add_action('cloudpress\companion\activated\materialis', function () {
      4     $sidebars_widgets = wp_get_sidebars_widgets();
      5 
      6     $sidebar_data = array();
      7     $sidebar_widget = null;
      8 
      9     if (isset($sidebars_widgets['sidebar-1'])) {
     10         $sidebar_data = $sidebars_widgets['sidebar-1'];
     11     }
     12 
     13 
     14 
     15     if (isset($sidebar_data[0])) {
     16         $sidebar_widget = $sidebar_data[0];
     17     }
     18 
     19     if ($sidebar_widget === 'block-2') {
     20         $widget_block_option = get_option('widget_block', array());
     21 
     22         if (isset($widget_block_option[2])) {
     23             $widget_block_option[2] = array(
     24                 'content' => '<!-- wp:search {"showLabel":false,"buttonUseIcon":true} /-->'
     25             );
     26             update_option('widget_block', $widget_block_option);
     27         }
     28     }
     29 });