Factory.php
1 week ago
IMedia.php
1 week ago
NonTranslatable.php
1 week ago
Translatable.php
1 week ago
Factory.php
21 lines
| 1 | <?php |
| 2 | |
| 3 | namespace WCML\Media\Wrapper; |
| 4 | |
| 5 | use WCML\StandAlone\NullSitePress; |
| 6 | |
| 7 | class Factory { |
| 8 | |
| 9 | public static function create() { |
| 10 | global $sitepress, $wpdb; |
| 11 | |
| 12 | $settingsFactory = new \WPML_Element_Sync_Settings_Factory(); |
| 13 | |
| 14 | if ( $settingsFactory->create( 'post' )->is_sync( 'attachment' ) ) { |
| 15 | return new Translatable( $sitepress, $wpdb ); |
| 16 | } |
| 17 | |
| 18 | return new NonTranslatable(); |
| 19 | } |
| 20 | } |
| 21 |