get_wp_api(); $template_service_loader = new WPML_Twig_Template_Loader( array( $wpml_wp_api->constant( 'WPML_MEDIA_PATH' ) . '/templates/menus/' ) ); $wpml_media_menus_factory = new WPML_Media_Menus_Factory(); return new WPML_Media( $sitepress, $wpdb, $wpml_media_menus_factory ); } }