From 6157d4715430c885b2fbddea3aab29b4497e8ee5 Mon Sep 17 00:00:00 2001 From: Daniele Scasciafratte Date: Wed, 6 Jul 2022 19:38:06 +0200 Subject: [PATCH 1/3] include berlindb by autoloader --- berlindb-example.php | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/berlindb-example.php b/berlindb-example.php index 72b3e6a..e645e34 100644 --- a/berlindb-example.php +++ b/berlindb-example.php @@ -17,18 +17,9 @@ $plugin_dir = plugin_dir_path( __FILE__ ); /** - * REQUIRE BERLINDB FILES. - * For now, BerlinDB files are manually required. + * REQUIRE BERLINDB. */ -require_once( $plugin_dir . 'core/base.php' ); -require_once( $plugin_dir . 'core/column.php' ); -require_once( $plugin_dir . 'core/meta.php' ); -require_once( $plugin_dir . 'core/compare.php' ); -require_once( $plugin_dir . 'core/date.php' ); -require_once( $plugin_dir . 'core/query.php' ); -require_once( $plugin_dir . 'core/row.php' ); -require_once( $plugin_dir . 'core/schema.php' ); -require_once( $plugin_dir . 'core/table.php' ); +require_once( $plugin_dir . 'core/autoloader.php' ); /** * BOOKS TABLE REQUIRED FILES. @@ -179,4 +170,4 @@ } return $content; -} ); \ No newline at end of file +} ); From 9d27611e335f1449a0e6a1fc8f92c9a035559346 Mon Sep 17 00:00:00 2001 From: Daniele Scasciafratte Date: Wed, 6 Jul 2022 19:41:25 +0200 Subject: [PATCH 2/3] feat(core): bump to latest update --- core | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core b/core index b46689f..da041d6 160000 --- a/core +++ b/core @@ -1 +1 @@ -Subproject commit b46689ff90b778da0456d7e2c5ccf0764bbce9d6 +Subproject commit da041d646d5349a0e263487bd01e8dc99477a185 From 4ea813fd616e00a0db80dfc1bbf2924850dc50df Mon Sep 17 00:00:00 2001 From: Daniele Scasciafratte Date: Thu, 7 Jul 2022 15:08:11 +0200 Subject: [PATCH 3/3] Avoid execution on REST api --- berlindb-example.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/berlindb-example.php b/berlindb-example.php index e645e34..28402c1 100644 --- a/berlindb-example.php +++ b/berlindb-example.php @@ -158,6 +158,10 @@ * This example hooks into WordPress's the_content, but this could be done anywhere. */ add_filter( 'the_content', function ( $content ) { + if ( defined('REST_REQUEST') ) { + return $content; + } + $query = new Book_Query( [ 'author' => 'J.K. Rowling', // Only get books written by J.K Rowling 'orderby' => 'date_published', // Sort the books by the date they were published