Plugin Directory

Changeset 3383670


Ignore:
Timestamp:
10/23/2025 11:50:19 PM (5 months ago)
Author:
moon0326
Message:

Release v1.0.25

Location:
wp-openapi/trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • wp-openapi/trunk/readme.txt

    r3361087 r3383670  
    55Tested up to: 6.7.2
    66Requires PHP: 7.1
    7 Stable tag: 1.0.24
     7Stable tag: 1.0.25
    88License: GPLv3
    99License URI: https://www.gnu.org/licenses/gpl-3.0.html
  • wp-openapi/trunk/src/SettingsPage.php

    r3269874 r3383670  
    4343                $checked = isset( $options['enableCallbackDiscovery'] ) && $options['enableCallbackDiscovery'] === 'on';
    4444                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 ) );
    4559            },
    4660            self::PAGE_ID,
     
    97111                $this->addTryItOption();
    98112                $this->addDiscoveryOption();
     113                $this->addACFIntegrationOption();
    99114            }
    100115        );
  • wp-openapi/trunk/src/Spec/Operation.php

    r3358117 r3383670  
    2828    private array $requestBodySchemaProperties = array();
    2929    private array $securities                  = array();
     30    private ?array $acfSchema                  = null;
    3031
    3132    private array $jsonSchemaSets = array(
     
    114115    }
    115116
     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
    116127    public function toArray(): array {
    117128        $data = array(
     
    152163        }
    153164
    154         if ( count( $this->requestBodySchemaProperties ) ) {
     165        if ( count( $this->requestBodySchemaProperties ) || $this->acfSchema ) {
    155166            $schema = array(
    156167                'type'       => 'object',
    157168                'properties' => $this->requestBodySchemaProperties,
    158169            );
     170
     171            // Add ACF schema if present
     172            if ( $this->acfSchema ) {
     173                $schema['properties']['acf'] = $this->acfSchema;
     174            }
    159175
    160176            $requiredProperties = array();
  • wp-openapi/trunk/vendor/composer/installed.php

    r3361087 r3383670  
    44        'pretty_version' => 'dev-main',
    55        'version' => 'dev-main',
    6         'reference' => 'dc65409b02c7a4ac88a746daedfe728d642e14c1',
     6        'reference' => '7d929c5012eba475cebb1d2c1ca6ac2d415ecb68',
    77        'type' => 'library',
    88        'install_path' => __DIR__ . '/../../',
     
    1414            'pretty_version' => 'dev-main',
    1515            'version' => 'dev-main',
    16             'reference' => 'dc65409b02c7a4ac88a746daedfe728d642e14c1',
     16            'reference' => '7d929c5012eba475cebb1d2c1ca6ac2d415ecb68',
    1717            'type' => 'library',
    1818            'install_path' => __DIR__ . '/../../',
  • wp-openapi/trunk/wp-openapi.php

    r3361087 r3383670  
    1010 * Plugin Name: WP OpenAPI
    1111 * Plugin URI: https://github.com/moon0326/wp-openapi
    12  * Version:     1.0.24
     12 * Version:     1.0.25
    1313 * Author:      Moon K
    1414 * Author URI: https://github.com/moon0326
     
    144144
    145145        new FixWPCoreCollectionEndpoints( $hooks );
     146
     147        if ( SettingsPage::getOption( 'enableACFIntegration' ) === 'on' ) {
     148            new Filters\AddACFSchema( $hooks, $restServer );
     149        }
    146150
    147151        $schemaGenerator = new SchemaGenerator( $hooks, $siteInfo, $restServer );
Note: See TracChangeset for help on using the changeset viewer.