title: Adding a custom Wordpress widget crashes the Media Library
body: <p>Im creating a custom Wordpress theme and recently the Media Library stopped working. I'm using ACF to create custom fields, and when I want to select an image the Media Library just keeps loading without showing any images.</p>
  
  <p>After some debugging I noticed that when removing the code that adds my custom widget, everything works fine.</p>
  
  <p>Now, my question is, how does the code below affect the functionality of the Media Library?</p>
  
  <pre><code>&lt;!-- 
  
  This widget is created to display some simple business information like a phone number and an address.
  If supplied the widget will also show icons for social medias such as Facebook, Instagram and Twitter.
  
   --&gt;
  &lt;?php 
  
  class info_widget extends WP_Widget {
  
      function __construct() {
          parent::__construct(
  
              // Base ID of your widget
              'info_widget', 
  
              // Widget name will appear in UI
              __('Information Widget', 'wpb_widget_domain'), 
  
              // Widget description
              array( 'description' =&gt; __('Simple widget to display some business information.', 'wpb_widget_domain' )) 
          );
      }
  
      // Creating widget front-end
      public function widget($args, $instance) {
  
          // before and after widget arguments are defined by themes
          echo $args['before_widget'];
  
          // This is where you run the code and display the output
  
          $phone = __($instance['phone'], 'wpb_widget_domain' );
          $address = __($instance['address'], 'wpb_widget_domain' );
          $facebook_link = __($instance['facebook_link'], 'wpb_widget_domain' );
          $twitter_link = __($instance['twitter_link'], 'wpb_widget_domain' );
          $youtube_link = __($instance['youtube_link'], 'wpb_widget_domain' );
  
          ?&gt;
  
          &lt;style type="text/css"&gt;
  
              .widget_info_widget {
                  height: 100%;
                  display: flex;
                  flex-direction: column;
              }
  
                  .widget_info_widget .wrapper {
                      flex-grow: 1;
                      display: flex;
                      flex-direction: column;
                      justify-content: center;
                  }
  
                      .widget_info_widget .wrapper p {
                          margin: 5px;
                      }
  
                      .widget_info_widget .wrapper a {
                          color: black;
                          text-decoration: none;
                      }
  
                      .widget_info_widget .wrapper a:hover {
                          text-decoration: underline;
                      }
  
                      .widget_info_widget .wrapper .icons {
                          margin-top: 20px;
                      }
  
                          .widget_info_widget .wrapper .icons .social {
                              font-size: 30px;
                              transition: filter 250ms;
                              color: black;
                              margin-left: 5px;
                              margin-right: 5px;
                          }
  
                          .widget_info_widget .wrapper .icons .social:hover {
                              filter: invert(0.5);
                          }
  
  
          &lt;/style&gt;
  
          &lt;center class="wrapper"&gt;
  
              &lt;p class="phone-number"&gt;&lt;?php echo $phone; ?&gt;&lt;/p&gt;
              &lt;p class="address"&gt;&lt;a href="https://www.google.se/maps/place/&lt;?php echo $address?&gt;"&gt;&lt;?php echo $address; ?&gt;&lt;/a&gt;&lt;/p&gt;
  
              &lt;div class="icons"&gt;
                  &lt;?php if (!empty($facebook_link)): ?&gt; 
                      &lt;a class="social" href="&lt;?php echo $facebook_link; ?&gt;"&gt;&lt;i class="fab fa-facebook"&gt;&lt;/i&gt;&lt;/a&gt;
                  &lt;?php endif; ?&gt;
  
                  &lt;?php if (!empty($twitter_link)): ?&gt; 
                      &lt;a class="social" href="&lt;?php echo $twitter_link; ?&gt;"&gt;&lt;i class="fab fa-twitter-square"&gt;&lt;/i&gt;&lt;/a&gt;
                  &lt;?php endif; ?&gt;
  
                  &lt;?php if (!empty($youtube_link)): ?&gt; 
                      &lt;a class="social" href="&lt;?php echo $youtube_link; ?&gt;"&gt;&lt;i class="fab fa-youtube-square"&gt;&lt;/i&gt;&lt;/a&gt;
                  &lt;?php endif; ?&gt;
              &lt;/div&gt;
          &lt;/center&gt;
  
  
  
  
  
          &lt;?php
          echo $args['after_widget'];
      }
  
      // Widget Backend 
      public function form($instance) {
  
          if (isset($instance['phone'] ) ) {
              $phone = $instance['phone'];
          }
          else {
              $phone = __('070-123 45 67', 'wpb_widget_domain');
          }
  
          if (isset($instance['address'] ) ) {
              $address = $instance['address'];
          }
          else {
              $address = __('Templateroad 5', 'wpb_widget_domain');
          }
  
          if (isset($instance['facebook_link'] ) ) {
              $facebook_link = $instance['facebook_link'];
          }
          if (isset($instance['twitter_link'] ) ) {
              $twitter_link = $instance['twitter_link'];
          }
          if (isset($instance['youtube_link'] ) ) {
              $youtube_link = $instance['youtube_link'];
          }
  
          // Widget admin form
          ?&gt;
  
              &lt;style type="text/css"&gt;
                  .widefat {
                      margin-bottom: 10px;
                  }
              &lt;/style&gt;
  
              &lt;p&gt;
                  &lt;label for="&lt;?php echo $this-&gt;get_field_id('phone'); ?&gt;"&gt;&lt;?php _e('Phone:'); ?&gt;&lt;/label&gt; 
                  &lt;input class="widefat" id="&lt;?php echo $this-&gt;get_field_id('phone'); ?&gt;" name="&lt;?php echo $this-&gt;get_field_name('phone'); ?&gt;" type="text" value="&lt;?php echo esc_attr($phone); ?&gt;" /&gt;
  
                  &lt;label for="&lt;?php echo $this-&gt;get_field_id('address'); ?&gt;"&gt;&lt;?php _e('Address:'); ?&gt;&lt;/label&gt; 
                  &lt;input class="widefat" id="&lt;?php echo $this-&gt;get_field_id('address'); ?&gt;" name="&lt;?php echo $this-&gt;get_field_name('address'); ?&gt;" type="text" value="&lt;?php echo esc_attr($address); ?&gt;" /&gt;
  
                  &lt;label for="&lt;?php echo $this-&gt;get_field_id('facebook_link'); ?&gt;"&gt;&lt;?php _e('Facebook Link (not required):'); ?&gt;&lt;/label&gt; 
                  &lt;input class="widefat" id="&lt;?php echo $this-&gt;get_field_id('facebook_link'); ?&gt;" name="&lt;?php echo $this-&gt;get_field_name('facebook_link'); ?&gt;" type="text" value="&lt;?php echo esc_attr($facebook_link); ?&gt;" /&gt;
  
                  &lt;label for="&lt;?php echo $this-&gt;get_field_id('twitter_link'); ?&gt;"&gt;&lt;?php _e('Twitter Link (not required):'); ?&gt;&lt;/label&gt; 
                  &lt;input class="widefat" id="&lt;?php echo $this-&gt;get_field_id('twitter_link'); ?&gt;" name="&lt;?php echo $this-&gt;get_field_name('twitter_link'); ?&gt;" type="text" value="&lt;?php echo esc_attr($twitter_link); ?&gt;" /&gt;
  
                  &lt;label for="&lt;?php echo $this-&gt;get_field_id('youtube_link'); ?&gt;"&gt;&lt;?php _e('Youtube Link (not required):'); ?&gt;&lt;/label&gt; 
                  &lt;input class="widefat" id="&lt;?php echo $this-&gt;get_field_id('youtube_link'); ?&gt;" name="&lt;?php echo $this-&gt;get_field_name('youtube_link'); ?&gt;" type="text" value="&lt;?php echo esc_attr($youtube_link); ?&gt;" /&gt;
              &lt;/p&gt;
          &lt;?php 
      }
  
      // Updating widget replacing old instances with new
      public function update($new_instance, $old_instance) {
          $instance = array();
          $instance['title'] = (!empty($new_instance['title'])) ? strip_tags($new_instance['title']) : '';
          $instance['phone'] = (!empty($new_instance['phone'])) ? strip_tags($new_instance['phone']) : '';
          $instance['address'] = (!empty($new_instance['address'])) ? strip_tags($new_instance['address']) : '';
          $instance['facebook_link'] = (!empty($new_instance['facebook_link'])) ? strip_tags($new_instance['facebook_link']) : '';
          $instance['twitter_link'] = (!empty($new_instance['twitter_link'])) ? strip_tags($new_instance['twitter_link']) : '';
          $instance['youtube_link'] = (!empty($new_instance['youtube_link'])) ? strip_tags($new_instance['youtube_link']) : '';
          return $instance;
      }
  }
  
  ?&gt;
  </code></pre>
  
  <p>The code in my functions.php file to load the widget looks like this:</p>
  
  <pre><code>// Custom info widget
  
  // Register and load the widget
  function load_widget() {
      register_widget('info_widget');
  }
  add_action('widgets_init', 'load_widget');
  
  include 'widgets/information_widget.php';
  </code></pre>
  
  <p>Any help is greatly appreciated and I'm relatively new to Wordpress so I might have missed something obvious but it just seems odd that the Media Library stops working..
  It should also be noted that the widget itself works properly, both backend and frontend!</p>