| Server IP : 193.146.211.90 / Your IP : 10.85.6.55 Web Server : Apache System : Linux wordpress-gti-69dcdb54f7-n4wdq 6.11.8-arch1-2 #1 SMP PREEMPT_DYNAMIC Fri, 15 Nov 2024 15:35:07 +0000 x86_64 User : 1001 ( 1001) PHP Version : 8.2.25 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /bitnami/wordpress/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;
}