Skip to content

Commit 566b2ff

Browse files
committed
Version 2.0.0
1 parent 07af4cb commit 566b2ff

File tree

5 files changed

+18
-17
lines changed

5 files changed

+18
-17
lines changed

.distignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@ Thumbs.db
1212
.gitignore
1313
composer.json
1414
composer.lock
15+
package-lock.json
1516
phpcs.xml
1617
readme.md

readme.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ See more [Meta Box plugins](https://metabox.io/plugins/).
1414

1515
If you like this plugin, you might also like our other WordPress products:
1616

17-
- [Meta Box](https://metabox.io) - The most powerful WordPress plugin for creating custom post types and custom fields.
17+
- [Meta Box](https://metabox.io) - A powerful WordPress plugin for creating custom post types and custom fields.
1818
- [Slim SEO](https://wpslimseo.com) - A fast, lightweight and full-featured SEO plugin for WordPress with minimal configuration.
19-
- [Slim SEO Schema](https://wpslimseo.com/products/slim-seo-schema/) - The best plugin to add schemas (structured data, rich snippets) to WordPress.
19+
- [Slim SEO Schema](https://wpslimseo.com/products/slim-seo-schema/) - An advanced, powerful and flexible plugin to add schemas to WordPress.
2020
- [Slim SEO Link Manager](https://wpslimseo.com/products/slim-seo-link-manager/) - Build internal link easier in WordPress with real-time reports.
2121
- [GretaThemes](https://gretathemes.com) - Free and premium WordPress themes that clean, simple and just work.
22-
- [Auto Listings](https://wpautolistings.com) - The car sale and dealership plugin for WordPress
22+
- [Auto Listings](https://wpautolistings.com) - A car sale and dealership plugin for WordPress.

readme.txt

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ Contributors: metabox, rilwis
33
Donate link: https://metabox.io/pricing/
44
Tags: meta-box, custom fields, custom field, meta, meta-boxes, field, rest, rest api, api, wp api, wp rest api, json
55
Requires at least: 4.1
6-
Tested up to: 6.3
7-
Stable tag: 1.5.1
8-
Requires PHP: 5.6
6+
Tested up to: 6.3.1
7+
Stable tag: 2.0.0
8+
Requires PHP: 7.0
99
License: GPLv2 or later
1010

1111
Get and update Meta Box custom fields to the WordPress REST API responses.
@@ -26,12 +26,12 @@ See more [Meta Box plugins](https://metabox.io/plugins/).
2626

2727
If you like this plugin, you might also like our other WordPress products:
2828

29-
- [Meta Box](https://metabox.io) - The most powerful WordPress plugin for creating custom post types and custom fields.
29+
- [Meta Box](https://metabox.io) - A powerful WordPress plugin for creating custom post types and custom fields.
3030
- [Slim SEO](https://wpslimseo.com) - A fast, lightweight and full-featured SEO plugin for WordPress with minimal configuration.
31-
- [Slim SEO Schema](https://wpslimseo.com/products/slim-seo-schema/) - The best plugin to add schemas (structured data, rich snippets) to WordPress.
31+
- [Slim SEO Schema](https://wpslimseo.com/products/slim-seo-schema/) - An advanced, powerful and flexible plugin to add schemas to WordPress.
3232
- [Slim SEO Link Manager](https://wpslimseo.com/products/slim-seo-link-manager/) - Build internal link easier in WordPress with real-time reports.
3333
- [GretaThemes](https://gretathemes.com) - Free and premium WordPress themes that clean, simple and just work.
34-
- [Auto Listings](https://wpautolistings.com) - The car sale and dealership plugin for WordPress
34+
- [Auto Listings](https://wpautolistings.com) - A car sale and dealership plugin for WordPress.
3535

3636
== Installation ==
3737

@@ -49,6 +49,11 @@ Repeat the same process for **WP REST API** and **MB Rest API**.
4949

5050
== Changelog ==
5151

52+
= 2.0.0 - 2022-10-11 =
53+
- Complete rewrite the plugin for clarity and maintainability
54+
- Add support for settings page, allow you to get and update data for settings pages
55+
- Show errors when updating non-existing fields
56+
5257
= 1.5.1 - 2022-08-16 =
5358
- Fix cannot update user meta in a custom table (#18)
5459

src/Base.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,7 @@ protected function get_values( $object_id, array $fields = [] ): array {
5959
$fields = $fields ?: $this->get_fields( $object_id );
6060

6161
$values = [];
62-
$args = [
63-
'object_type' => $this->object_type,
64-
];
62+
$args = [ 'object_type' => $this->object_type ];
6563
foreach ( $fields as $field ) {
6664
$value = rwmb_get_value( $field['id'], $args, $object_id );
6765
$value = $this->normalize_value( $field, $value );

src/Setting.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,7 @@ private function get_settings_page( WP_REST_Request $request ): array {
5454
}
5555
}
5656

57-
$this->send_error_message(
58-
'settings_page_not_exists',
59-
// Translators: %s - settings page id.
60-
sprintf( __( "Settings page '%s' does not exist.", 'mb-rest-api' ), $id )
61-
);
57+
// Translators: %s - settings page id.
58+
$this->send_error_message( 'settings_page_not_exists', sprintf( __( "Settings page '%s' does not exist.", 'mb-rest-api' ), $id ) );
6259
}
6360
}

0 commit comments

Comments
 (0)