$field ) ) { continue; } $update->$field = $info->$field; } return $update; } /** * Transform the update into the format used by WordPress native plugin API. * * @return object */ public function to_wp_format() { $update = new StdClass; $update->id = $this->id; $update->plugin = $this->plugin; $update->slug = $this->slug; $update->new_version = $this->version; $update->url = $this->homepage; $update->package = $this->download_url; if ( ! empty( $this->upgrade_notice ) ) { $update->upgrade_notice = $this->upgrade_notice; } // Support custom $update properties coming straight from PUE if ( ! empty( $this->custom_update ) ) { $custom_update = get_object_vars( $this->custom_update ); foreach ( $custom_update as $field => $custom_value ) { if ( is_object( $custom_value ) ) { $custom_value = get_object_vars( $custom_value ); } $update->$field = $custom_value; } } return $update; } } }