HEX
Server: Apache
System: Linux 4485441ca2e2 6.8.0-1039-aws #41~22.04.1-Ubuntu SMP Thu Sep 11 11:03:07 UTC 2025 aarch64
User: (1000)
PHP: 8.2.24
Disabled: NONE
Upload Files
File: /var/www/html/wp-content/plugins/wordpress-popular-posts/src/Shortcode/Shortcode.php
<?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;
}