You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello. I glad when see your package. Everything working very good.
I checked when I create duplicate category name. It will return error because term is exist. It should return term id. I think.
The text was updated successfully, but these errors were encountered:
class TermExistsException extends WordPressException
{
public $data;
public function __construct(WordPressError $error)
{
parent::__construct($error, 400);
$this->data = $error->data;
}
public function getData()
{
return $this->data;
}
}
and my controller
public function createCategory($data)
{
try {
return $this->wp->category()->create($data);
}
catch (WordPressException $exception){
if (method_exists($exception, 'getData') && ($data = $exception->getData()) && !empty($data->term_id)) {
return $this->wp->category()->retrieve($data->term_id);
}
return false;
}
}
Hello. I glad when see your package. Everything working very good.
I checked when I create duplicate category name. It will return error because term is exist. It should return term id. I think.
The text was updated successfully, but these errors were encountered: