Skip to content

Instantly share code, notes, and snippets.

@rohit-ghoghari
Created February 18, 2021 09:16
Show Gist options
  • Save rohit-ghoghari/51eb38a4f497dc963440d317da2647d7 to your computer and use it in GitHub Desktop.
Save rohit-ghoghari/51eb38a4f497dc963440d317da2647d7 to your computer and use it in GitHub Desktop.
<?php
/**
* Used Code :'wc-custom-post-widget.php'.
*/
class Elementor_Repeter_Widgets {
protected static $instance = null;
public static function get_instance() {
if ( ! isset( static::$instance ) ) {
static::$instance = new static;
}
return static::$instance;
}
protected function __construct() {
require_once('wc-widget.php');
add_action( 'elementor/widgets/widgets_registered', [ $this, 'register_widgets' ] );
}
public function register_widgets() {
\Elementor\Plugin::instance()->widgets_manager->register_widget_type( new \Elementor\Elementor_Repeter_Widget() );
}
}
add_action( 'init', 'elementor_repeter_widget_callback' );
function elementor_repeter_widget_callback() {
Elementor_Repeter_Widgets::get_instance();
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment