- Timestamp:
- 08/10/2026 03:32:57 AM (2 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
roxyapi/trunk/src/Generated/Shortcodes/CalculateBridgeNumbers.php
r3637152 r3639910 22 22 public const TAG = 'roxy_calculate_bridge_numbers'; 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 'full_name' => '', 33 'year' => '', 34 'month' => '', 35 'day' => '', 36 'lang' => '', 37 'hide_readings' => 'inherit', 38 ); 39 24 40 public static function register(): void { 25 41 if ( shortcode_exists( self::TAG ) ) { … … 31 47 public static function render( $atts, $content = '', $tag = '' ): string { 32 48 $atts = shortcode_atts( 33 array( 34 'full_name' => '', 35 'year' => '', 36 'month' => '', 37 'day' => '', 38 'hide_readings' => 'inherit', 39 ), 49 self::DEFAULTS, 40 50 is_array( $atts ) ? $atts : array(), 41 51 (string) $tag … … 55 65 } 56 66 ); 57 $data = \RoxyAPI\Generated\Client::calculateBridgeNumbers( $body ); 67 $query = array_filter( 68 array( 69 'lang' => $atts['lang'], 70 ), 71 static function ( $v ) { 72 return $v !== ''; 73 } 74 ); 75 $data = \RoxyAPI\Generated\Client::calculateBridgeNumbers( $body, $query ); 58 76 59 77 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)