Changeset 3802095 for mega-ai/trunk/mega.php
- Timestamp:
- 11/14/2026 02:34:30 PM (less than one hour ago)
- File:
-
- 1 edited
-
mega-ai/trunk/mega.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
mega-ai/trunk/mega.php
r3802069 r3802095 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 4.05 Version: 2.45.0 6 6 Author: MEGA 7 7 Author URI: https://gomega.ai … … 115 115 116 116 private static $namespace = 'mega'; 117 private static $version = '2.4 4.0';117 private static $version = '2.45.0'; 118 118 119 119 // Editor (widget) endpoints. … … 840 840 // options, read only, optional `contains` filter. See custom-fields.php. 841 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') 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 ), 845 852 )); 846 853 … … 4243 4250 $contains = $request->get_param('contains'); 4244 4251 $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()); 4245 4267 return \is_wp_error($result) ? $result : new \WP_REST_Response($result); 4246 4268 }
Note:
See TracChangeset
for help on using the changeset viewer.