1. Go to this page and download the library: Download wpfulcrum/shortcode 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/ */
wpfulcrum / shortcode example snippets
return [
/**
* Defines whether the shortcode should autoload when registering with Fulcrum.
*
* Default is true.
*/
'autoload' => true,
/**
* If you'd like to build your own shortcode class, specify the class name here, such as:
*
* Fulcrum\Custom\Shortcode\Shortcode
*
* By default, it will use the built-in Shortcode class.
*/
'classname' => '',
'config' => [
/**
* Specify the name of the shortcode. This is the "tag" which is used in the content as: [foo].
*/
'shortcode' => 'foo',
/**
* Set this parameter to `true` when no view file is needed for this shortcode.
*/
'noView' => false,
/**
* Specify the absolute path to this shortcode's view file.
* The view file contains the HTML that is built for this shortcode.
*/
'view' => __DIR__ . '/views/foo.php',
/**
* Specify the default attributes for this shortcode.
*/
'defaults' => [
'class' => 'foobar',
],
],
];
<p class=" echo $this->getClass();
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.