Changeset 3383670
- Timestamp:
- 10/23/2025 11:50:19 PM (5 months ago)
- Location:
- wp-openapi/trunk
- Files:
-
- 2 added
- 5 edited
-
readme.txt (modified) (1 diff)
-
resources/views/settings-acf-integration.php (added)
-
src/Filters/AddACFSchema.php (added)
-
src/SettingsPage.php (modified) (2 diffs)
-
src/Spec/Operation.php (modified) (3 diffs)
-
vendor/composer/installed.php (modified) (2 diffs)
-
wp-openapi.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-openapi/trunk/readme.txt
r3361087 r3383670 5 5 Tested up to: 6.7.2 6 6 Requires PHP: 7.1 7 Stable tag: 1.0.2 47 Stable tag: 1.0.25 8 8 License: GPLv3 9 9 License URI: https://www.gnu.org/licenses/gpl-3.0.html -
wp-openapi/trunk/src/SettingsPage.php
r3269874 r3383670 43 43 $checked = isset( $options['enableCallbackDiscovery'] ) && $options['enableCallbackDiscovery'] === 'on'; 44 44 echo ( new View( 'settings-discovery' ) )->render( array( 'checked' => $checked ) ); 45 }, 46 self::PAGE_ID, 47 $this->sectionId 48 ); 49 } 50 51 private function addACFIntegrationOption() { 52 add_settings_field( 53 'wp-openapi-settings-acf-integration', 54 'Enable ACF Integration', 55 function() { 56 $options = get_option( self::OPTION_ID ); 57 $checked = isset( $options['enableACFIntegration'] ) && $options['enableACFIntegration'] === 'on'; 58 echo ( new View( 'settings-acf-integration' ) )->render( array( 'checked' => $checked ) ); 45 59 }, 46 60 self::PAGE_ID, … … 97 111 $this->addTryItOption(); 98 112 $this->addDiscoveryOption(); 113 $this->addACFIntegrationOption(); 99 114 } 100 115 ); -
wp-openapi/trunk/src/Spec/Operation.php
r3358117 r3383670 28 28 private array $requestBodySchemaProperties = array(); 29 29 private array $securities = array(); 30 private ?array $acfSchema = null; 30 31 31 32 private array $jsonSchemaSets = array( … … 114 115 } 115 116 117 /** 118 * Set ACF schema for this operation's request body 119 * 120 * @param array $acfSchema The ACF schema to add 121 * @return void 122 */ 123 public function setACFSchema( array $acfSchema ): void { 124 $this->acfSchema = $acfSchema; 125 } 126 116 127 public function toArray(): array { 117 128 $data = array( … … 152 163 } 153 164 154 if ( count( $this->requestBodySchemaProperties ) ) {165 if ( count( $this->requestBodySchemaProperties ) || $this->acfSchema ) { 155 166 $schema = array( 156 167 'type' => 'object', 157 168 'properties' => $this->requestBodySchemaProperties, 158 169 ); 170 171 // Add ACF schema if present 172 if ( $this->acfSchema ) { 173 $schema['properties']['acf'] = $this->acfSchema; 174 } 159 175 160 176 $requiredProperties = array(); -
wp-openapi/trunk/vendor/composer/installed.php
r3361087 r3383670 4 4 'pretty_version' => 'dev-main', 5 5 'version' => 'dev-main', 6 'reference' => ' dc65409b02c7a4ac88a746daedfe728d642e14c1',6 'reference' => '7d929c5012eba475cebb1d2c1ca6ac2d415ecb68', 7 7 'type' => 'library', 8 8 'install_path' => __DIR__ . '/../../', … … 14 14 'pretty_version' => 'dev-main', 15 15 'version' => 'dev-main', 16 'reference' => ' dc65409b02c7a4ac88a746daedfe728d642e14c1',16 'reference' => '7d929c5012eba475cebb1d2c1ca6ac2d415ecb68', 17 17 'type' => 'library', 18 18 'install_path' => __DIR__ . '/../../', -
wp-openapi/trunk/wp-openapi.php
r3361087 r3383670 10 10 * Plugin Name: WP OpenAPI 11 11 * Plugin URI: https://github.com/moon0326/wp-openapi 12 * Version: 1.0.2 412 * Version: 1.0.25 13 13 * Author: Moon K 14 14 * Author URI: https://github.com/moon0326 … … 144 144 145 145 new FixWPCoreCollectionEndpoints( $hooks ); 146 147 if ( SettingsPage::getOption( 'enableACFIntegration' ) === 'on' ) { 148 new Filters\AddACFSchema( $hooks, $restServer ); 149 } 146 150 147 151 $schemaGenerator = new SchemaGenerator( $hooks, $siteInfo, $restServer );
Note: See TracChangeset
for help on using the changeset viewer.