| Server IP : 195.130.67.5 / Your IP : 216.73.216.231 Web Server : Microsoft-IIS/10.0 System : Windows NT WEBSERVER1 10.0 build 17763 (Windows Server 2016) i586 User : IUSR ( 0) PHP Version : 7.4.19 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/inetpub/wwwroot/ia/wp-content/plugins/wordpress-popular-posts/src/Shortcode/ |
Upload File : |
<?php
namespace WordPressPopularPosts\Shortcode;
abstract class Shortcode {
/**
* Shortcode tag (eg. footag)
*
* @since 6.3.0
* @var string
* @access protected
*/
protected $tag;
/**
* Initializes shortcode.
*
*/
public function init()
{
$this->register();
}
/**
* Registers the shortcode
*
* @since 6.3.0
*/
public function register() : void
{
if ( $this->tag ) {
add_shortcode( $this->tag, [$this, 'handle'] );
}
}
/**
* Handles the HTML output of the shortcode.
*
* @since 6.3.0
* @param array $attributes Array of attributes passed to the shortcode
* @return string $html HTML output
*/
abstract public function handle(array $attributes) : string;
}