# my-wp/trunk/shortcode/abstract.shortcode.module.php

My WP Customize Admin/Frontend, version trunk. 50 lines.

- Page: https://pluginprobe.com/plugins/my-wp/trunk/code/shortcode/abstract.shortcode.module.php
- Raw: https://pluginprobe.com/plugins/my-wp/trunk/raw/shortcode/abstract.shortcode.module.php
- Modified: 2021-07-24T14:39:14+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/my-wp/trunk/code/shortcode/abstract.shortcode.module.php#L10-L20`.

```php
<?php

if ( ! defined( 'ABSPATH' ) ) {
  exit;
}

if ( ! class_exists( 'MywpShortcodeAbstractModule' ) ) :

abstract class MywpShortcodeAbstractModule {

  protected static $id;

  public static function init() {

    $class = get_called_class();

    if( empty( static::$id ) ) {

      $called_text = sprintf( 'class %s' , $class );

      MywpHelper::error_require_message( '"static protected $id"' , $called_text );

      return false;

    }

    add_filter( 'mywp_shortcode' , array( $class , 'mywp_shortcode' ) );

  }

  public static function mywp_shortcode( $shortcodes ) {

    $class = get_called_class();

    $shortcodes[ static::$id ] = array( $class , 'do_shortcode' );

    return $shortcodes;

  }

  public static function do_shortcode( $atts = false , $content = false , $tag = false ) {

    return $content;

  }

}

endif;

```
