Version Description
- 2021-12-15 =
- Fix warning for post field caused by the search by post title
Download this release
Release Info
Developer | rilwis |
Plugin | Meta Box |
Version | 5.5.1 |
Comparing to | |
See all releases |
Code changes from version 5.5.0 to 5.5.1
- inc/fields/post.php +12 -13
- inc/loader.php +1 -1
- meta-box.php +1 -1
- readme.txt +4 -1
inc/fields/post.php
CHANGED
@@ -178,25 +178,24 @@ class RWMB_Post_Field extends RWMB_Object_Choice_Field {
|
|
178 |
*
|
179 |
* @link https://developer.wordpress.org/reference/hooks/posts_search/
|
180 |
*/
|
181 |
-
public static function search_by_title( $search,
|
182 |
global $wpdb;
|
183 |
if ( empty( $search ) ) {
|
184 |
return $search;
|
185 |
}
|
186 |
-
$q
|
187 |
-
$n
|
188 |
-
$search
|
189 |
-
$searchand = '';
|
190 |
foreach ( (array) $q['search_terms'] as $term ) {
|
191 |
-
$term
|
192 |
-
$search
|
193 |
-
$searchand = ' AND ';
|
194 |
}
|
195 |
-
if (
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
|
|
200 |
}
|
201 |
return $search;
|
202 |
}
|
178 |
*
|
179 |
* @link https://developer.wordpress.org/reference/hooks/posts_search/
|
180 |
*/
|
181 |
+
public static function search_by_title( $search, $wp_query ) {
|
182 |
global $wpdb;
|
183 |
if ( empty( $search ) ) {
|
184 |
return $search;
|
185 |
}
|
186 |
+
$q = $wp_query->query_vars;
|
187 |
+
$n = ! empty( $q['exact'] ) ? '' : '%';
|
188 |
+
$search = array();
|
|
|
189 |
foreach ( (array) $q['search_terms'] as $term ) {
|
190 |
+
$term = esc_sql( $wpdb->esc_like( $term ) );
|
191 |
+
$search[] = "($wpdb->posts.post_title LIKE '{$n}{$term}{$n}')";
|
|
|
192 |
}
|
193 |
+
if ( empty( $search ) ) {
|
194 |
+
return $search;
|
195 |
+
}
|
196 |
+
$search = ' AND (' . implode( ' AND ', $search ) . ') ';
|
197 |
+
if ( ! is_user_logged_in() ) {
|
198 |
+
$search .= " AND ($wpdb->posts.post_password = '') ";
|
199 |
}
|
200 |
return $search;
|
201 |
}
|
inc/loader.php
CHANGED
@@ -18,7 +18,7 @@ class RWMB_Loader {
|
|
18 |
*/
|
19 |
protected function constants() {
|
20 |
// Script version, used to add version for scripts and styles.
|
21 |
-
define( 'RWMB_VER', '5.5.
|
22 |
|
23 |
list( $path, $url ) = self::get_path( dirname( dirname( __FILE__ ) ) );
|
24 |
|
18 |
*/
|
19 |
protected function constants() {
|
20 |
// Script version, used to add version for scripts and styles.
|
21 |
+
define( 'RWMB_VER', '5.5.1' );
|
22 |
|
23 |
list( $path, $url ) = self::get_path( dirname( dirname( __FILE__ ) ) );
|
24 |
|
meta-box.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: Meta Box
|
4 |
* Plugin URI: https://metabox.io
|
5 |
* Description: Create custom meta boxes and custom fields in WordPress.
|
6 |
-
* Version: 5.5.
|
7 |
* Author: MetaBox.io
|
8 |
* Author URI: https://metabox.io
|
9 |
* License: GPL2+
|
3 |
* Plugin Name: Meta Box
|
4 |
* Plugin URI: https://metabox.io
|
5 |
* Description: Create custom meta boxes and custom fields in WordPress.
|
6 |
+
* Version: 5.5.1
|
7 |
* Author: MetaBox.io
|
8 |
* Author URI: https://metabox.io
|
9 |
* License: GPL2+
|
readme.txt
CHANGED
@@ -5,7 +5,7 @@ Tags: meta box, custom fields, custom post types, custom taxonomies, cpt, meta b
|
|
5 |
Requires at least: 4.3
|
6 |
Requires PHP: 5.6
|
7 |
Tested up to: 5.8.2
|
8 |
-
Stable tag: 5.5.
|
9 |
License: GPLv2 or later
|
10 |
|
11 |
Meta Box plugin is a powerful, professional developer toolkit to create custom meta boxes and custom fields for your custom post types in WordPress.
|
@@ -168,6 +168,9 @@ To getting started with the plugin, please read the [Quick Start Guide](https://
|
|
168 |
|
169 |
== Changelog ==
|
170 |
|
|
|
|
|
|
|
171 |
= 5.5.0 - 2021-12-14 =
|
172 |
- Add `min_clone` parameter to set the minimum number of clones. Props @baden03.
|
173 |
- Post field: find by title only
|
5 |
Requires at least: 4.3
|
6 |
Requires PHP: 5.6
|
7 |
Tested up to: 5.8.2
|
8 |
+
Stable tag: 5.5.1
|
9 |
License: GPLv2 or later
|
10 |
|
11 |
Meta Box plugin is a powerful, professional developer toolkit to create custom meta boxes and custom fields for your custom post types in WordPress.
|
168 |
|
169 |
== Changelog ==
|
170 |
|
171 |
+
= 5.5.1 - 2021-12-15 =
|
172 |
+
- Fix warning for post field caused by the search by post title
|
173 |
+
|
174 |
= 5.5.0 - 2021-12-14 =
|
175 |
- Add `min_clone` parameter to set the minimum number of clones. Props @baden03.
|
176 |
- Post field: find by title only
|