rockschtar/wordpress-shortcode

This package is abandoned and no longer maintained. No replacement package was suggested.

Library for simple wordpress shortcode creation

1.0.0 2021-10-12 12:21 UTC

This package is auto-updated.

Last update: 2024-04-19 16:28:00 UTC


README

Requirements

License

rockschtar/wordpress-shortcode is open source and released under MIT license. See LICENSE file for more info.

Usage

Create a shortcode class

class TestShortcode extends AbstractShortcode {

    public function getShortcodeName(): string {
        return 'myshortcode';
    }

    public function display_shortcode($attributes): string {

        $parsed_attributes = wp_parse_args($attributes, ['foo' => 'bar']);
        $output = 'This is my shortcode ' . $parsed_attributes['foo'];
        return $output;
    }
}

Initialize the class

TestShortcode::init();

Question? Issues?

rockschtar/wordpress-shortcode is hosted on GitLab. Feel free to open issues there for suggestions, questions and real issues.