| 1 |
<?php |
| 2 |
|
| 3 |
namespace Better_Payment\Lite\Campaign\Elements; |
| 4 |
|
| 5 |
if ( ! defined( 'ABSPATH' ) ) { |
| 6 |
exit; |
| 7 |
} |
| 8 |
|
| 9 |
/** |
| 10 |
* Fatal guard for Better Payment Pro 1.4.3 and older. Holds no schema. |
| 11 |
* |
| 12 |
* The Donors Wall, FAQ and Video schemas and default settings ship with Pro |
| 13 |
* (better-payment-pro/includes/Campaign/ProElementSchemas.php); a free install gets |
| 14 |
* {@see ProElementStubs}. Lite's transitional copy of the schemas was deleted when |
| 15 |
* ProCompatibility::MIN_PRO_VERSION reached 1.4.4. |
| 16 |
* |
| 17 |
* What stays is only what Pro 1.4.3 reads directly: its `BuilderElements` aliases |
| 18 |
* these constants at class-constant time and calls {@see self::default_video_url()}, |
| 19 |
* so removing them would fatal every campaign render on a site that updated Lite |
| 20 |
* before Pro. Pro 1.4.4+ reads its own class. Pinned by |
| 21 |
* tests/Unit/ProCouplingContractTest.php; delete this file once no supported site |
| 22 |
* can run Pro 1.4.3. |
| 23 |
* |
| 24 |
* @deprecated Kept only so Better Payment Pro <= 1.4.3 does not fatal. |
| 25 |
*/ |
| 26 |
class ProElementSchemas { |
| 27 |
|
| 28 |
/** |
| 29 |
* The video a newly added Video element starts with. |
| 30 |
* |
| 31 |
* Pro 1.4.3's `BuilderElements::DEFAULT_VIDEO_URL` aliases this constant. |
| 32 |
*/ |
| 33 |
const DEFAULT_VIDEO_URL = 'https://www.youtube.com/watch?v=jeXG-4SOlZE'; |
| 34 |
|
| 35 |
/** |
| 36 |
* Seconds into {@see self::DEFAULT_VIDEO_URL} that playback starts. |
| 37 |
*/ |
| 38 |
const DEFAULT_VIDEO_START = 2; |
| 39 |
|
| 40 |
/** |
| 41 |
* Filterable default video URL. |
| 42 |
* |
| 43 |
* @return string |
| 44 |
*/ |
| 45 |
public static function default_video_url(): string { |
| 46 |
return (string) apply_filters( 'better_payment/campaign/default_video_url', self::DEFAULT_VIDEO_URL ); |
| 47 |
} |
| 48 |
} |
| 49 |
|