Changeset 3802069 for mega-ai/trunk/mega.php
- Timestamp:
- 11/14/2026 02:18:23 PM (less than one hour ago)
- File:
-
- 1 edited
-
mega-ai/trunk/mega.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
mega-ai/trunk/mega.php
r3801985 r3802069 3 3 Plugin Name: MEGA AI 4 4 Description: Connect your WordPress website to MEGA for automated SEO optimization and content management. 5 Version: 2.4 3.05 Version: 2.44.0 6 6 Author: MEGA 7 7 Author URI: https://gomega.ai … … 88 88 try { 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); } 89 89 try { 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); } 90 try { if (MegaModules::present('custom-fields.php')) { require_once(__DIR__ . '/custom-fields.php'); } } catch (\Throwable $e) { MegaModules::fail('custom-fields.php', $e); } 90 91 try { if (MegaModules::present('phone-replace.php')) { require_once(__DIR__ . '/phone-replace.php'); } } catch (\Throwable $e) { MegaModules::fail('phone-replace.php', $e); } 91 92 try { if (MegaModules::present('woocommerce-webhook.php')) { require_once(__DIR__ . '/woocommerce-webhook.php'); } } catch (\Throwable $e) { MegaModules::fail('woocommerce-webhook.php', $e); } … … 114 115 115 116 private static $namespace = 'mega'; 116 private static $version = '2.4 3.0';117 private static $version = '2.44.0'; 117 118 118 119 // Editor (widget) endpoints. … … 834 835 'permission_callback' => array($this, 'check_authenticated_permission') 835 836 ), 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') 836 845 )); 837 846 … … 4220 4229 } 4221 4230 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); 4222 4246 } 4223 4247
Note:
See TracChangeset
for help on using the changeset viewer.