PHP code example of wp-media / plugin-family

1. Go to this page and download the library: Download wp-media/plugin-family library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

wp-media / plugin-family example snippets


use WPMedia\PluginFamily\Model\PluginFamily;

class View {
    protected $plugin_family;

    public function __construct( $plugin_family ) {
        $this->plugin_family = $plugin_family;
    }

    public function display_page() {
		$plugin_family = $this->plugin_family->get_filtered_plugins( 'imagify/imagify' );

		$data = [
			'plugin_family' => $plugin_family['uncategorized'],
		];

		$this->print_template( 'page-settings', $data );
	}
}

use WPMedia\PluginFamily\Controller\{ PluginFamily, PluginFamilyInterface };

class Subscriber implements SubscriberInterface, PluginFamilyInterface {

    protected $plugin_family;

    public function __construct( $plugin_family ) {
        $this->plugin_family = $plugin_family;
    }

	public static function get_subscribed_events() {
        $events = PluginFamily::get_subscribed_events();

        return $events;
	}

    public function install_activate() {
        $this->plugin_family->install_activate();
    }

    public function display_error_notice() {
        $this->plugin_family->display_error_notice();
    }
}