Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions includes/entity/class-item.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,19 +115,19 @@ public function __call( $method, $params ) {
$var = strtolower( substr( $method, 4 ) );

if ( strncasecmp( $method, 'get', 3 ) === 0 ) {
return $this->$var;
return property_exists( $this, $var ) ? $this->$var : '';
}

if ( strncasecmp( $method, 'has', 3 ) === 0 ) {
return ! empty( $this->$var );
return property_exists( $this, $var ) && ! empty( $this->$var );
}

if ( strncasecmp( $method, 'set', 3 ) === 0 ) {
$this->$var = current( $params );
}

if ( strncasecmp( $method, 'add', 3 ) === 0 ) {
if ( ! $this->$var ) {
if ( ! property_exists( $this, $var ) || ! $this->$var ) {
call_user_func( array( $this, 'set_' . $var ), current( $params ) );
return true;
}
Expand Down
1 change: 1 addition & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ Project and support maintained on github at [pfefferle/wordpress-webmention](htt

### 5.6.0

* Fix undefined property warning in `Item::__call` magic method when accessing non-existent properties like `category`.
* Search Avatar Store if enabled for match before trying meta field. Disable updating meta field when side loading allowing for more flexibility.
* Fix editor plugin error on custom post types without `custom-fields` support.
* Add video/audio URL extraction as content fallback for webmentions without text content.
Expand Down
Loading