Plugin Directory


Ignore:
Timestamp:
11/14/2026 02:34:30 PM (less than one hour ago)
Author:
joegomega
Message:

Update to version 2.45.0 from GitHub

File:
1 edited

Legend:

Unmodified
Added
Removed
  • mega-ai/trunk/mega.php

    r3802069 r3802095  
    33Plugin Name: MEGA AI
    44Description: Connect your WordPress website to MEGA for automated SEO optimization and content management.
    5 Version: 2.44.0
     5Version: 2.45.0
    66Author: MEGA
    77Author URI: https://gomega.ai
    … …  
    115115
    116116    private static $namespace = 'mega';
    117     private static $version = '2.44.0';
     117    private static $version = '2.45.0';
    118118
    119119    // Editor (widget) endpoints.
    … …  
    840840        // options, read only, optional `contains` filter. See custom-fields.php.
    841841        \register_rest_route(self::$namespace . '/v1', '/editor/custom-fields/(?P<id>\d+)', array(
    842             'methods' => \WP_REST_Server::READABLE,
    843             'callback' => array($this, 'get_editor_custom_fields'),
    844             'permission_callback' => array($this, 'check_authenticated_permission')
     842            array(
     843                'methods' => \WP_REST_Server::READABLE,
     844                'callback' => array($this, 'get_editor_custom_fields'),
     845                'permission_callback' => array($this, 'check_authenticated_permission')
     846            ),
     847            array(
     848                'methods' => \WP_REST_Server::CREATABLE,
     849                'callback' => array($this, 'post_editor_custom_fields'),
     850                'permission_callback' => array($this, 'check_authenticated_permission')
     851            ),
    845852        ));
    846853
    … …  
    42434250        $contains = $request->get_param('contains');
    42444251        $result = MegaCustomFields::read((int) $request['id'], is_string($contains) ? $contains : '');
     4252        return \is_wp_error($result) ? $result : new \WP_REST_Response($result);
     4253    }
     4254
     4255    /**
     4256     * POST /mega/v1/editor/custom-fields/{id}
     4257     *   { "field_name": "...", "expected_value_sha256": hex64, "value": "...", "mega_change_log_bypass": true }
     4258     *
     4259     * Guarded write of one ACF text, textarea or wysiwyg field (2.45.0). See custom-fields.php.
     4260     */
     4261    public function post_editor_custom_fields(\WP_REST_Request $request) {
     4262        if (!MegaModules::loaded('custom-fields.php')) {
     4263            return $this->editor_error('MODULE_UNAVAILABLE', 'The custom-fields module is not loaded on this site.', 503);
     4264        }
     4265        $body = $request->get_json_params();
     4266        $result = MegaCustomFields::write((int) $request['id'], is_array($body) ? $body : array());
    42454267        return \is_wp_error($result) ? $result : new \WP_REST_Response($result);
    42464268    }
Note: See TracChangeset for help on using the changeset viewer.