Changeset 3772660
- Timestamp:
- 10/29/2026 10:42:49 AM (3 days ago)
- Location:
- automaize-event-calendar/trunk
- Files:
-
- 4 edited
-
automaize-event-calendar.php (modified) (2 diffs)
-
includes/class-aec-rest.php (modified) (2 diffs)
-
includes/class-aec-settings.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
automaize-event-calendar/trunk/automaize-event-calendar.php
r3772653 r3772660 3 3 * Plugin Name: Automaize Event Calendar 4 4 * Description: Displays upcoming events in a responsive tile grid with recurring event support and optional WooCommerce integration. 5 * Version: 1.6. 25 * Version: 1.6.3 6 6 * Author: Automaize 7 7 * Author URI: https://automaize.app … … 18 18 } 19 19 20 define( 'AMZEC_VERSION', '1.6. 2' );20 define( 'AMZEC_VERSION', '1.6.3' ); 21 21 define( 'AMZEC_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); 22 22 define( 'AMZEC_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); -
automaize-event-calendar/trunk/includes/class-aec-rest.php
r3772653 r3772660 198 198 register_rest_route( 199 199 self::NAMESPACE_, 200 '/staff/settings', 201 array( 202 array( 203 'methods' => WP_REST_Server::READABLE, 204 'callback' => array( __CLASS__, 'get_staff_settings' ), 205 'permission_callback' => array( __CLASS__, 'check_api_key' ), 206 ), 207 array( 208 'methods' => WP_REST_Server::EDITABLE, 209 'callback' => array( __CLASS__, 'update_staff_settings' ), 210 'permission_callback' => array( __CLASS__, 'check_api_key' ), 211 ), 212 ) 213 ); 214 215 register_rest_route( 216 self::NAMESPACE_, 200 217 '/staff/media', 201 218 array( … … 586 603 587 604 return rest_ensure_response( array( 'success' => true ) ); 605 } 606 607 /** 608 * GET /staff/settings - the subset of Events > Einstellungen that the 609 * app also lets staff change directly (currently: "Anzahl Events" / 610 * "Sichtbarkeit in die Zukunft"). Everything else on that settings page 611 * (API key, accent color, button text) stays wp-admin-only. 612 * 613 * @return WP_REST_Response 614 */ 615 public static function get_staff_settings() { 616 $opts = AMZEC_Settings::get_options(); 617 return rest_ensure_response( 618 array( 619 'default_count' => (int) $opts['default_count'], 620 'default_future_days' => (int) $opts['default_future_days'], 621 ) 622 ); 623 } 624 625 /** 626 * PUT /staff/settings { default_count?, default_future_days? } 627 * 628 * @param WP_REST_Request $request Request. 629 * @return WP_REST_Response 630 */ 631 public static function update_staff_settings( WP_REST_Request $request ) { 632 return rest_ensure_response( AMZEC_Settings::update_display_defaults( $request->get_params() ) ); 588 633 } 589 634 -
automaize-event-calendar/trunk/includes/class-aec-settings.php
r3708972 r3772660 279 279 280 280 /** 281 * Updates just default_count/default_future_days, leaving every other 282 * option (api_key, primary_color, ...) untouched - used by the staff 283 * REST route so the app can offer these two without a way to overwrite 284 * the rest of this option via a partial payload. 285 * 286 * @param array $data { default_count?, default_future_days? } 287 * @return array{default_count:int, default_future_days:int} 288 */ 289 public static function update_display_defaults( array $data ) { 290 $current = get_option( self::OPTION_KEY, array() ); 291 292 if ( isset( $data['default_count'] ) ) { 293 $current['default_count'] = max( 1, min( 100, absint( $data['default_count'] ) ) ); 294 } 295 if ( isset( $data['default_future_days'] ) ) { 296 $current['default_future_days'] = absint( $data['default_future_days'] ); 297 } 298 299 update_option( self::OPTION_KEY, $current ); 300 301 $opts = self::get_options(); 302 return array( 303 'default_count' => (int) $opts['default_count'], 304 'default_future_days' => (int) $opts['default_future_days'], 305 ); 306 } 307 308 /** 281 309 * Returns the merged options with defaults. 282 310 */ -
automaize-event-calendar/trunk/readme.txt
r3772653 r3772660 5 5 Tested up to: 7.0 6 6 Requires PHP: 7.4 7 Stable tag: 1.6. 27 Stable tag: 1.6.3 8 8 License: GPL-2.0-or-later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 79 79 == Changelog == 80 80 81 = 1.6.3 = 82 * New: `GET`/`PUT /amzec/v1/staff/settings` exposes "Anzahl Events" and "Sichtbarkeit in die Zukunft" (from Events > Einstellungen) to the app, so staff can change how many events show without a trip to wp-admin. 83 81 84 = 1.6.2 = 82 85 * Fix: `GET /amzec/v1/events` (used by the website's homepage) ignored the "Anzahl Events" setting under Events > Einstellungen when the caller didn't pass its own `count` - it silently fell back to a hardcoded 12 instead. It now falls back to the configured setting, same as the `[amzec_events]` shortcode already did.
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)