Inpsyde\MultilingualPress\Module\ModuleManager::get_modules PHP Метод

get_modules() публичный Метод

Returns all modules with the given state.
С версии: 3.0.0
public get_modules ( integer $state = self::MODULE_STATE_ALL ) : Module[]
$state integer Optional. State of the modules. Defaults to all modules.
Результат Module[] Array of module objects.
    public function get_modules($state = self::MODULE_STATE_ALL);

Usage Example

Пример #1
0
    /**
     * Renders the markup.
     *
     * @since 3.0.0
     *
     * @return void
     */
    public function render()
    {
        $this->asset_manager->enqueue_style('multilingualpress-admin');
        $action = PluginSettingsUpdater::ACTION;
        ?>
		<div class="wrap">
			<h1><?php 
        echo esc_html(get_admin_page_title());
        ?>
</h1>
			<form method="post" action="<?php 
        echo admin_url("admin-post.php?action={$action}");
        ?>
"
				id="multilingualpress-modules">
				<?php 
        echo \Inpsyde\MultilingualPress\nonce_field($this->nonce);
        ?>
				<table class="mlp-module-list">
					<?php 
        foreach ($this->module_manager->get_modules() as $id => $module) {
            /**
             * Filters if the module should be listed on the settings page.
             *
             * @since 3.0.0
             *
             * @param bool $show_module Whether or not the module should be listed on the settings page.
             */
            if (apply_filters("multilingualpress.show_module_{$id}", true)) {
                $this->render_module($module);
            }
        }
        /**
         * Fires at the end of but still inside the module list on the settings page.
         *
         * @since 3.0.0
         */
        do_action('multilingualpress.in_module_list');
        ?>
				</table>
				<?php 
        /**
         * Fires right after after the module list on the settings page.
         *
         * @since 3.0.0
         */
        do_action('multilingualpress.after_module_list');
        submit_button(__('Save Changes', 'multilingual-press'));
        ?>
			</form>
		</div>
		<?php 
    }
All Usage Examples Of Inpsyde\MultilingualPress\Module\ModuleManager::get_modules