Plugin Directory


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

Update to version 2.44.0 from GitHub

File:
1 edited

Legend:

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

    r3801985 r3802069  
    33Plugin Name: MEGA AI
    44Description: Connect your WordPress website to MEGA for automated SEO optimization and content management.
    5 Version: 2.43.0
     5Version: 2.44.0
    66Author: MEGA
    77Author URI: https://gomega.ai
    … …  
    8888try { if (MegaModules::present('template-preview.php', 'sandbox.php', 'sandbox-helpers.php')) { require_once(__DIR__ . '/template-preview.php'); } } catch (\Throwable $e) { MegaModules::fail('template-preview.php', $e); }
    8989try { if (MegaModules::present('page-duplicate.php', 'sandbox.php', 'sandbox-helpers.php')) { require_once(__DIR__ . '/page-duplicate.php'); } } catch (\Throwable $e) { MegaModules::fail('page-duplicate.php', $e); }
     90try { if (MegaModules::present('custom-fields.php')) { require_once(__DIR__ . '/custom-fields.php'); } } catch (\Throwable $e) { MegaModules::fail('custom-fields.php', $e); }
    9091try { if (MegaModules::present('phone-replace.php')) { require_once(__DIR__ . '/phone-replace.php'); } } catch (\Throwable $e) { MegaModules::fail('phone-replace.php', $e); }
    9192try { if (MegaModules::present('woocommerce-webhook.php')) { require_once(__DIR__ . '/woocommerce-webhook.php'); } } catch (\Throwable $e) { MegaModules::fail('woocommerce-webhook.php', $e); }
    … …  
    114115
    115116    private static $namespace = 'mega';
    116     private static $version = '2.43.0';
     117    private static $version = '2.44.0';
    117118
    118119    // Editor (widget) endpoints.
    … …  
    834835                'permission_callback' => array($this, 'check_authenticated_permission')
    835836            ),
     837        ));
     838
     839        // Where a page's text is stored outside its builder (v2.44.0): ACF fields, public post meta, theme mods and ACF
     840        // options, read only, optional `contains` filter. See custom-fields.php.
     841        \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')
    836845        ));
    837846
    … …  
    42204229        }
    42214230        return array('tree' => $tree, 'empty' => $empty, 'info' => $info, 'filled' => $filled, 'offsets' => $offsets, 'ids' => $ids);
     4231    }
     4232
     4233    /**
     4234     * GET /mega/v1/editor/custom-fields/{id}[?contains=text]
     4235     *
     4236     * Read only: the post's ACF fields, public post meta, the theme's customizer values and ACF options, each with
     4237     * its source and the key a write must address. See custom-fields.php.
     4238     */
     4239    public function get_editor_custom_fields(\WP_REST_Request $request) {
     4240        if (!MegaModules::loaded('custom-fields.php')) {
     4241            return $this->editor_error('MODULE_UNAVAILABLE', 'The custom-fields module is not loaded on this site.', 503);
     4242        }
     4243        $contains = $request->get_param('contains');
     4244        $result = MegaCustomFields::read((int) $request['id'], is_string($contains) ? $contains : '');
     4245        return \is_wp_error($result) ? $result : new \WP_REST_Response($result);
    42224246    }
    42234247
Note: See TracChangeset for help on using the changeset viewer.