Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 54
0.00% covered (danger)
0.00%
0 / 3
CRAP
n/a
0 / 0
Automattic\Jetpack\Podcast\Admin_Pages\Create_AI_Podcast\window_presets
0.00% covered (danger)
0.00%
0 / 26
0.00% covered (danger)
0.00%
0 / 1
2
Automattic\Jetpack\Podcast\Admin_Pages\Create_AI_Podcast\length_presets
0.00% covered (danger)
0.00%
0 / 14
0.00% covered (danger)
0.00%
0 / 1
2
Automattic\Jetpack\Podcast\Admin_Pages\Create_AI_Podcast\voice_presets
0.00% covered (danger)
0.00%
0 / 14
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2/**
3 * Shared preset arrays for the Create AI Podcast page.
4 *
5 * Values mirror what `dashboard/create/presets.ts` exported before the page
6 * moved to this stack. PHP renders the form's <select> options from these
7 * arrays; the JS island receives the same arrays via wp_localize_script so
8 * status notices can label runs by preset id.
9 *
10 * @package automattic/jetpack-podcast
11 */
12
13namespace Automattic\Jetpack\Podcast\Admin_Pages\Create_AI_Podcast;
14
15/**
16 * Date-range presets for the "from a window" source mode.
17 *
18 * @return array<int, array{id:string,label:string,unit:string,n:int}>
19 */
20function window_presets(): array {
21    return array(
22        array(
23            'id'    => 'last-7-days',
24            'label' => __( 'Last 7 days', 'jetpack-podcast' ),
25            'unit'  => 'days',
26            'n'     => 7,
27        ),
28        array(
29            'id'    => 'last-14-days',
30            'label' => __( 'Last 14 days', 'jetpack-podcast' ),
31            'unit'  => 'days',
32            'n'     => 14,
33        ),
34        array(
35            'id'    => 'last-30-days',
36            'label' => __( 'Last 30 days', 'jetpack-podcast' ),
37            'unit'  => 'days',
38            'n'     => 30,
39        ),
40        array(
41            'id'    => 'last-3-months',
42            'label' => __( 'Last 3 months', 'jetpack-podcast' ),
43            'unit'  => 'months',
44            'n'     => 3,
45        ),
46    );
47}
48
49/**
50 * Episode-length presets.
51 *
52 * @return array<int, array{id:string,label:string}>
53 */
54function length_presets(): array {
55    return array(
56        array(
57            'id'    => 'short',
58            'label' => __( 'Short (~3 min)', 'jetpack-podcast' ),
59        ),
60        array(
61            'id'    => 'medium',
62            'label' => __( 'Medium (~7 min)', 'jetpack-podcast' ),
63        ),
64        array(
65            'id'    => 'long',
66            'label' => __( 'Long (~12 min)', 'jetpack-podcast' ),
67        ),
68    );
69}
70
71/**
72 * Voice-style presets.
73 *
74 * @return array<int, array{id:string,label:string}>
75 */
76function voice_presets(): array {
77    return array(
78        array(
79            'id'    => 'witty',
80            'label' => __( 'Witty', 'jetpack-podcast' ),
81        ),
82        array(
83            'id'    => 'earnest',
84            'label' => __( 'Earnest', 'jetpack-podcast' ),
85        ),
86        array(
87            'id'    => 'professional',
88            'label' => __( 'Professional', 'jetpack-podcast' ),
89        ),
90    );
91}