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

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

- Page: https://pluginprobe.com/plugins/posts-data-table/1.4.11/code/src/Plugin_Factory.php
- Raw: https://pluginprobe.com/plugins/posts-data-table/1.4.11/raw/src/Plugin_Factory.php
- Modified: 2021-10-08T18:15:12+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.4.11/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.com>
 * @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;
	}

}

```
