source/php/Module.php
public function register($slug, $nameSingular, $namePlural, $description, $supports = array(), $icon = null, $plugin = null, $cache_ttl = 0, $hideTitle = false)
    {
        //\Modularity\Helper\Wp::deprecatedFunction('Function $module->' . __FUNCTION__ . ' is deprecated since Modularity version 2.0.0');

        if (empty($slug)) {
            return;
        }

        add_action('Modularity/Init', function ($moduleManager) use ($slug, $nameSingular, $namePlural, $description, $supports, $icon, $plugin, $cache_ttl, $hideTitle) {
            $module = new \Modularity\Module();
            $module->slug = $slug;
            $module->nameSingular = $nameSingular;
            $module->namePlural = $namePlural;
            $module->description = $description;
            $module->supports = $supports;
            $module->icon = $icon;
            $module->plugin = $plugin;
            $module->cacheTtl = $cache_ttl;
            $module->hideTitle = $hideTitle;
            $module->isDeprecated = $this->isDeprecated;
            $module->ghost = true;

            $class = get_class($this);
            $class = explode('\\', $class);
            $moduleManager->register($module, MODULARITY_PATH . 'source/php/Module/' . end($class));
        });
    }
public function register($slug, $nameSingular, $namePlural, $description, $supports = array(), $icon = null, $plugin = null, $cache_ttl = 0, $hideTitle = false)
    {
        //\Modularity\Helper\Wp::deprecatedFunction('Function $module->' . __FUNCTION__ . ' is deprecated since Modularity version 2.0.0');

        if (empty($slug)) {
            return;
        }

        add_action('Modularity/Init', function ($moduleManager) use ($slug, $nameSingular, $namePlural, $description, $supports, $icon, $plugin, $cache_ttl, $hideTitle) {
            $module = new \Modularity\Module();
            $module->slug = $slug;
            $module->nameSingular = $nameSingular;
            $module->namePlural = $namePlural;
            $module->description = $description;
            $module->supports = $supports;
            $module->icon = $icon;
            $module->plugin = $plugin;
            $module->cacheTtl = $cache_ttl;
            $module->hideTitle = $hideTitle;
            $module->isDeprecated = $this->isDeprecated;
            $module->ghost = true;

            $class = get_class($this);
            $class = explode('\\', $class);
            $moduleManager->register($module, MODULARITY_PATH . 'source/php/Module/' . end($class));
        });
    }
public function register ( $ slug , $ nameSingular , $ namePlural , $ description , $ supports = array ( ) , $ icon = null , $ plugin = null , $ cache_ttl = 0 , $ hideTitle = false ) { //\Modularity\Helper\Wp::deprecatedFunction('Function $module->' . __FUNCTION__ . ' is deprecated since Modularity version 2.0.0'); if ( empty ( $ slug ) ) { return ; } add_action ( 'Modularity/Init' , function ( $ moduleManager ) use ( $ slug , $ nameSingular , $ namePlural , $ description , $ supports , $ icon , $ plugin , $ cache_ttl , $ hideTitle ) { $ module = new \ Modularity \ Module ( ) ; $ module -> slug = $ slug ; $ module -> nameSingular = $ nameSingular ; $ module -> namePlural = $ namePlural ; $ module -> description = $ description ; $ module -> supports = $ supports ; $ module -> icon = $ icon ; $ module -> plugin = $ plugin ; $ module -> cacheTtl = $ cache_ttl ; $ module -> hideTitle = $ hideTitle ; $ module -> isDeprecated = $ this -> isDeprecated ; $ module -> ghost = true ; $ class = get_class ( $ this ) ; $ class = explode ( '\\' , $ class ) ; $ moduleManager -> register ( $ module , MODULARITY_PATH . 'source/php/Module/' . end ( $ class ) ) ; } ) ; }
Registers a Modularity module

@deprecated 2.0.0
@deprecated No longer used by internal code and not recommended, exists as fallback for old third party modules
@deprecated Now creates a "ghost" module class to initialize old module type

@param  string $slug         Module id suffix (will be prefixed with constant MODULE_PREFIX)
@param  string $nameSingular Singular name of the module
@param  string $namePlural   Plural name of the module
@param  string $description  Description of the module
@param  array  $supports     Which core post type fileds this module supports
@param  string $icon
@param  string $plugin
@param  int    $cache_ttl
@param  bool   $hideTitle
@return string               The prefixed module id/slug
Registers a Modularity module