# posts-data-table/1.3.4/src/Plugin_Factory.php

Posts Table with Search &amp; Sort, version 1.3.4. 24 lines.

- Page: https://pluginprobe.com/plugins/posts-data-table/1.3.4/code/src/Plugin_Factory.php
- Raw: https://pluginprobe.com/plugins/posts-data-table/1.3.4/raw/src/Plugin_Factory.php
- Modified: 2020-08-13T17:46:16+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/posts-data-table/1.3.4/code/src/Plugin_Factory.php#L10-L20`.

```php
<?php
namespace Barn2\Plugin\Posts_Table_Search_Sort;

/**
 * Factory to create/return the shared plugin instance.
 *
 * @package   Barn2\posts-table-search-sort
 * @author    Barn2 Plugins <support@barn2.co.uk>
 * @license   GPL-3.0
 * @copyright Barn2 Media Ltd
 */
class Plugin_Factory {

    private static $plugin = null;

    public static function create( $file, $version ) {
        if ( null === self::$plugin ) {
            self::$plugin = new Plugin( $file, $version );
        }
        return self::$plugin;
    }

}

```
