Allow metadata fetch() method without arguments

In order to keep consistent with Collection, Items, Filters and others, Metadata fetch method should allow to be called without arguments.
This commit is contained in:
Alan Tygel 2024-10-21 22:06:53 -03:00 committed by mateuswetah
parent fe43d298fa
commit 4c65d6b1b0
1 changed files with 1 additions and 1 deletions

View File

@ -344,7 +344,7 @@ class Metadata extends Repository {
* @return Entities\Metadatum|\WP_Query|Array an instance of wp query OR array of entities;
* @throws \Exception
*/
public function fetch( $args, $output = null ) {
public function fetch( $args = [], $output = null ) {
if ( is_numeric( $args ) ) {
$existing_post = get_post( $args );