Skip to content

A standalone version of WordPress shortcodes system for use outside WordPress.

License

Notifications You must be signed in to change notification settings

nabeghe/wp-shortcodes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WP Shortcodes

The standalone version of WordPress shortcodes system for use outside of WordPress.

Notice: The kses-related parts have been removed from the shortcode system and are currently not supported.

🫡 Usage

🚀 Installation

You can install the package via composer:

composer require nabeghe/wp-shortcodes

📁 Localization Directory

Example

use Nabeghe\WPShortcodes\Shortcodes;

$shortcodes = new Shortcodes();
$shortcodes->add('hash', function ($atts, $content = null) {
    $atts['algo'] ??= 'md5';
    return hash($atts['algo'], $content);
});

$result = $shortcodes->do('
MD5 = [hash algo="md5"]https://github.com/nabeghe/wp-shortcodes[/hash]
SJA256 = [hash algo="sha256"]https://github.com/nabeghe/wp-shortcodes[/hash]
');
echo $result;

📖 License

Copyright (c) 2024 Hadi Akbarzadeh

Licensed under the GPL-2.0+ license, see LICENSE.md for details.

About

A standalone version of WordPress shortcodes system for use outside WordPress.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages