PHP code example of jayjay666 / wp-requirements-checker

1. Go to this page and download the library: Download jayjay666/wp-requirements-checker library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

jayjay666 / wp-requirements-checker example snippets


use jayjay666\WPRequirementsChecker\Validator;

// ... code before plugin/theme init


// ... start init code with
// Set PHP version, plugin root file path and plugin text domain
$validator = new Validator('7.1', 'my-awesome-plugin/my-awesome-plugin.php', 'my-awesome-plugin');

// Set plugins print error & disable plugin in check() method ad break code
    return;
}

// ... if 

// Namespace & prefix must be yours!!!
if (!class_exists( 'jayjay666\WPRequirementsChecker\Validator') ) {
    // do the file include or 

use Elementor\Controls_Manager;use Elementor\Element_Section;
use jayjay666\WPRequirementsChecker\Validator;

class MyAwesomePlugin{
    const DOMAIN = 'my-awesome-plugin';
    
    private static $_instance = null;

    public static function instance()
    {

        if (is_null(self::$_instance)) {
            self::$_instance = new self();
        }
        return self::$_instance;
    }
    
    public function __construct()
    {
        add_action('plugins_loaded', [$this, 'init']);
    }
    
    public function init()
    {
        // Check d_section_controls(Element_Section $element)
    {
        //
        // Přidám responzivní pro zarovnání slopců
        $element->add_responsive_control(
            'scb_section_horizontal_align',
            [
                'label' => __('Horizontal align', MyAwesomePlugin::DOMAIN),
                'type' => Controls_Manager::SELECT,
                'default' => '',
                'options' => [
                    '' => __('Default', 'elementor'),
                    'flex-start' => __('Start', 'elementor'),
                    'flex-end' => __('End', 'elementor'),
                    'center' => __('Center', 'elementor'),
                    'space-between' => __('Space Between', 'elementor'),
                    'space-around' => __('Space Around', 'elementor'),
                    'space-evenly' => __('Space Evenly', 'elementor'),
                ],
                'selectors' => [ // Zde se předají data do CSS
                    '{{WRAPPER}} .elementor-row' => 'justify-content: {{VALUE}};',
                ],
            ]
        );
    }
}