# learnpress/4.4.7/inc/Shortcodes/AbstractShortcode.php

LearnPress – WordPress LMS Plugin for Create and Sell Online Courses, version 4.4.7. 31 lines.

- Page: https://pluginprobe.com/plugins/learnpress/4.4.7/code/inc/Shortcodes/AbstractShortcode.php
- Raw: https://pluginprobe.com/plugins/learnpress/4.4.7/raw/inc/Shortcodes/AbstractShortcode.php
- Modified: 2026-09-11T09:28:34+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/learnpress/4.4.7/code/inc/Shortcodes/AbstractShortcode.php#L10-L20`.

```php
<?php

namespace LearnPress\Shortcodes;

/**
 * Class AbstractShortcode
 *
 * @package LearnPress\Shortcodes
 * @since 4.2.3
 * @version 1.0.0
 */
abstract class AbstractShortcode {
	protected $prefix = 'learn_press_';
	protected $shortcode_name;

	protected function init() {
		// Register shortcode.
		add_shortcode( $this->prefix . $this->shortcode_name, array( $this, 'render' ) );
	}

	/**
	 * Render template of shortcode.
	 * If not set any attribute on short, $attrs is empty string.
	 *
	 * @param string|array $attrs
	 *
	 * @return string
	 */
	abstract public function render( $attrs ): string;
}

```
