register_all(); } } add_action( 'elementor/theme/register_locations', 'accepta_register_elementor_locations' ); /** * Add custom Elementor widgets categories * * @param \Elementor\Elements_Manager $elements_manager Elementor elements manager. */ function accepta_add_elementor_widget_categories( $elements_manager ) { $elements_manager->add_category( 'accepta-elements', [ 'title' => esc_html__( 'Accepta Elements', 'accepta' ), 'icon' => 'fa fa-plug', ] ); } add_action( 'elementor/elements/categories_registered', 'accepta_add_elementor_widget_categories' ); /** * Add default Elementor color scheme. * * @param array $schemes An array of Elementor color schemes. * @return array Modified schemes array. */ function accepta_elementor_default_colors( $schemes ) { // Get the existing scheme 1 $schemes_obj = new \Elementor\Core\Schemes\Color(); $scheme_1 = $schemes_obj->get_scheme( 'color' ); // Define your custom colors $custom_colors = [ 1 => '#1abc9c', // Primary 2 => '#333333', // Secondary 3 => '#555555', // Text 4 => '#f5f5f5', // Accent ]; // Merge the custom colors with existing foreach( $custom_colors as $index => $color ) { if ( isset( $scheme_1[ $index ] ) ) { $schemes[ $index ] = $color; } } return $schemes; } add_filter( 'elementor/schemes/default_color', 'accepta_elementor_default_colors' );