shortcode not return any thing in Gutnburg

Question

I need to create a shortcode in a plugin, when a person gets to install my plugin can he use shortcode inside the plugin :

that’s my code plugin is working 100%
but when I call to shortcode [splite] nothing returned


class aligoPlugin
{
    public function __construct()
    {
        // hooks
        add_action( 'init',  array($this,'register_shortcodes') );
    }

    // activate
    public function activate()
    {
        $this->splite_article();
        // add_shortcode('splite', 'splite_article');
        // flush rewrite rules
        flush_rewrite_rules();
    }

    // functions
    function register_shortcodes(){
        add_shortcode('splite', 'splite_article');
    }

    // shortCodes
    function splite_article()
    {
        $content = "hhhhh";
        echo $content;
    }
}
if (class_exists('aligoPlugin'))
    $aligo = new aligoPlugin();

// activation
register_activation_hook(__FILE__, array($aligo,'activate'));

0
Alhiane 4 months 0 Answers 7 views 0

Leave an answer