Example #1
0
                    <p>Click the button below to empty the folder containing the ACF Local JSON-files.</p>
                    <input type="submit" name="fewbricks_deletejson" value="Delete ACF Local JSON" class="button"/>
                </form>

            </div>

        </div>

        <div class="acf-box">

            <div class="title"><h3>Developer mode</h3></div>

            <div class="inner">

              <?php 
    if (\fewbricks\helpers\is_fewbricks_in_developer_mode()) {
        ?>
                <p>Fewbricks developer mode is active.</p>
              <?php 
    } else {
        ?>
                <p>Fewbricks developer mode is _not_ active.</p>
              <?php 
    }
    ?>

                <p>By setting Fewbricks in developer mode, some extra debugging related to Febricks and ACF will become available. Also, every time a field group is registered, a check for duplicate keys will be carried out. Please make sure that you don't have developer mode enabled on production servers since this will have impact on performance. Read more about Fewbricks developer mode and how to enable it in the <a href="https://github.com/folbert/fewbricks/blob/master/README.md">Fewbricks README file</a>.</p>

                <p>If developer mode is enabled, you can also var dump all registered field groups and its fields each time a field group is registered. This is done by adding a get variable named "dumpfewbricksfields" to any page. For example <a href="<?php 
    echo get_option('home');
    ?>
Example #2
0
 /**
  * Register a field group.
  */
 public function register()
 {
     global $fewbricks_save_json;
     if (!isset($this->settings['names_of_items_to_hide_on_screen']) && !isset($this->settings['names_of_items_to_show_on_screen'])) {
         $this->settings['hide_on_screen'] = $this->get_hide_on_screen_settings();
     } elseif (isset($this->settings['names_of_items_to_show_on_screen'])) {
         $this->settings['hide_on_screen'] = $this->get_hide_on_screen_settings(false, $this->settings['names_of_items_to_show_on_screen']);
     } else {
         $this->settings['hide_on_screen'] = $this->get_hide_on_screen_settings($this->settings['names_of_items_to_hide_on_screen'], false);
     }
     $this->settings['fields'] = $this->set_unique_keys($this->settings['fields'], $this->settings['key']);
     if (\fewbricks\helpers\is_fewbricks_in_developer_mode()) {
         if ($fewbricks_save_json === true) {
             $this->save_json();
         } elseif (isset($_GET['dumpfewbricksfields'])) {
             $this->print_settings();
         } else {
             $this->check_keys($this->settings['fields']);
         }
     }
     register_field_group($this->settings);
 }