Plugin_Factory.php in Posts Table with Search & Sort 1.3, at src/Plugin_Factory.php
| 1 | <?php |
| 2 | |
| 3 | namespace Barn2\Plugin\Posts_Table_Search_Sort; |
| 4 | |
| 5 | /** |
| 6 | * Factory to create/return the shared plugin instance. |
| 7 | * |
| 8 | * @author Barn2 Media <info@barn2.co.uk> |
| 9 | * @license GPL-3.0 |
| 10 | * @copyright Barn2 Media Ltd |
| 11 | */ |
| 12 | class Plugin_Factory { |
| 13 | |
| 14 | private static $plugin = null; |
| 15 | |
| 16 | public static function create( $file, $version ) { |
| 17 | if ( null === self::$plugin ) { |
| 18 | self::$plugin = new Plugin( $file, $version ); |
| 19 | } |
| 20 | return self::$plugin; |
| 21 | } |
| 22 | |
| 23 | } |
| 24 |