Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The error "Call to undefined method Elementor\WidgetsManager::register()" occurs when trying to register a widget in Elementor using an outdated method. To fix this error, you need to change the register method to addcontrol in your code. Here are the steps to fix this error:

  1. Locate the file where the error occurs.
  2. Search for the line that contains the method register.
  3. Change the method register to add_control.
  4. Save the file and refresh the page to see if the error is resolved.

For example, replace the code:

$this->widgets_manager->register_widget_type( new \Elementor\Widget_Text() );

with:

$this->widgets_manager->add_control( 'text', [
    'label' => __( 'Text', 'elementor' ),
    'type' => \Elementor\Controls_Manager::TEXT,
    'default' => __( 'Default text', 'elementor' ),
] );

This should resolve the error and allow you to register your widget successfully in Elementor.