Changeset 3639910 for roxyapi/trunk/src/Generated/Shortcodes/GetPhases.php
- Timestamp:
- 08/10/2026 03:32:57 AM (2 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
roxyapi/trunk/src/Generated/Shortcodes/GetPhases.php
r3637152 r3639910 22 22 public const TAG = 'roxy_get_phases'; 23 23 24 /** 25 * Every attribute this shortcode accepts. shortcode_atts() silently 26 * discards anything absent from here, so this is also the contract the 27 * library copy-paste sample is checked against. 28 * 29 * @var array<string, string> 30 */ 31 public const DEFAULTS = array( 32 'birth_date' => '', 33 'target_date' => '', 34 'lang' => '', 35 'hide_readings' => 'inherit', 36 ); 37 24 38 public static function register(): void { 25 39 if ( shortcode_exists( self::TAG ) ) { … … 31 45 public static function render( $atts, $content = '', $tag = '' ): string { 32 46 $atts = shortcode_atts( 33 array( 34 'birth_date' => '', 35 'target_date' => '', 36 'hide_readings' => 'inherit', 37 ), 47 self::DEFAULTS, 38 48 is_array( $atts ) ? $atts : array(), 39 49 (string) $tag … … 51 61 } 52 62 ); 53 $data = \RoxyAPI\Generated\Client::getPhases( $body ); 63 $query = array_filter( 64 array( 65 'lang' => $atts['lang'], 66 ), 67 static function ( $v ) { 68 return $v !== ''; 69 } 70 ); 71 $data = \RoxyAPI\Generated\Client::getPhases( $body, $query ); 54 72 55 73 if ( is_wp_error( $data ) ) {
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)