diff --git a/berlindb-example.php b/berlindb-example.php index 72b3e6a..28402c1 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. @@ -167,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 @@ -179,4 +174,4 @@ } return $content; -} ); \ No newline at end of file +} ); diff --git a/core b/core index b46689f..da041d6 160000 --- a/core +++ b/core @@ -1 +1 @@ -Subproject commit b46689ff90b778da0456d7e2c5ccf0764bbce9d6 +Subproject commit da041d646d5349a0e263487bd01e8dc99477a185