Elementor Class Compatibility Update

User
Assistant
If you want to adapt the plugin code for the new `ElementorCoreSchemesColor` class, you can update it as follows:

<?php
/**
 * Plugin Name: Elementor CoreSchemesColor and CoreSchemesTypography Class Issue
 **/

namespace Elementor;

add_action(
    'plugins_loaded',
    function () {
        if ( ! class_exists( 'ElementorCoreSchemesColor' ) ) {
            class Scheme_Color extends CoreSchemesColor {}
        }
    }
);

add_action(
    'plugins_loaded',
    function () {
        if ( ! class_exists( 'ElementorCoreSchemesTypography' ) ) {
            class Scheme_Typography extends CoreSchemesTypography {}
        }
    }
);

### Explanation of Changes:
1. The namespace for `Scheme_Color` and `Scheme_Typography` has been updated to use `ElementorCoreSchemesColor` and `ElementorCoreSchemesTypography` respectively.
2. The logic ensures backward compatibility by checking if the classes already exist before declaring them.

If the original `Scheme_Color` and `Scheme_Typography` classes are being deprecated, this approach provides a shim for plugins or themes relying on the older namespace while transitioning to the new one.

Leave a Comment

Your email address will not be published. Required fields are marked *