Closed dy-git-hub closed 3 years ago
Pages and posts edit page in WP admin throw this error message in the console:
Could not find DOM element for container "carbon_fields_container_carbon_fields_widget_podcasts-2".
A blank page is loaded, and the WordPress editor is not accessible.
class ThemeWidgetExample extends Widget { // Register widget function. Must have the same name as the class function __construct() { $this->setup( 'widget_podcasts', 'Widget Podcasts', 'Widget Podcasts', array( Field::make( 'text', 'widget_podcasts_title', 'Widget Title' ), Field::make( 'complex', 'podcasts', 'Podcasts' ) ->add_fields( array( Field::make('text', 'link', 'Podcast Link'), Field::make('image', 'image_id', 'Podcast Link Image') ) ) ) ); } // Called when rendering the widget in the front-end function front_end( $args, $instance ) { echo $args['before_title'] . $instance['widget_podcasts_title'] . $args['after_title']; $html = '<ul class="podcasts">'; foreach ($instance['podcasts'] as $key => $podcast) { $html .= '<li class="podcast">'; $html .= '<a href="' . $podcast['link'] . '" rel="noopener nofollow" target="_blank">'; $html .= '<figure class="podcast__image">'; $html .= wp_get_attachment_image($podcast['image_id'], 'medium'); $html .= '</figure> <!-- ./podcast__image -->'; $html .= '</a> '; $html .= '</li> <!-- ./podcast -->'; } $html .= '</ul>'; echo $html; } } function load_widgets() { register_widget( 'ThemeWidgetExample' ); } add_action( 'widgets_init', 'load_widgets' );
register_sidebar(array( 'name' => 'Podcast Sidebar', 'id' => 'podcast', 'class' => 'widgets', 'before_widget' => '<li id="%1$s" class="widget %2$s">', 'after_widget' => '</li>', 'before_title' => '<h2 class="widget__title">', 'after_title' => '</h2>', ));
I've got the same problem after upgrade to 3.3 version...
Fixed in v3.3.1 :)
Version
Actual Behavior
Pages and posts edit page in WP admin throw this error message in the console:
Could not find DOM element for container "carbon_fields_container_carbon_fields_widget_podcasts-2".
A blank page is loaded, and the WordPress editor is not accessible.
Container definition
Steps to Reproduce the Problem