PHP code example of jaybizzle / shortcodes

1. Go to this page and download the library: Download jaybizzle/shortcodes 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/ */

    

jaybizzle / shortcodes example snippets




namespace App\Shortcodes;

use Jaybizzle\Shortcodes\Shortcode;

class VideoShortcode extends Shortcode
{
    public static $shortcode = 'video';

    public function parse()
    {
        // All shortcode attributes will be available in $this->attr
        // i.e. given the example above...
        // $this->attr['title']
        // $this->attr['videoID']
        // $this->attr['width']
        // $this->attr['height']
    }
}



namespace App\Libraries;

use App\Shortcodes\VideoShortcode;
use Jaybizzle\Shortcodes\Shortcodes;

class MyClass
{
    public function index()
    {
        $shortcodes = new Shortcodes
        $shortcodes->add(VideoClass::class);
    }
}