fix cli to move attachments no new strucutre #241

This commit is contained in:
Leo Germani 2019-08-05 10:46:52 -03:00 committed by Mateus Machado Luna
parent 43da161b78
commit 154f5107c2
1 changed files with 2 additions and 2 deletions

View File

@ -133,9 +133,9 @@ class Cli_Move_Attachments {
private function is_item_attachment($att) { private function is_item_attachment($att) {
$ThemeHelper = \Tainacan\Theme_Helper::get_instance(); $ThemeHelper = \Tainacan\Theme_Helper::get_instance();
if ($att->parent > 0) { if ($att->post_parent > 0) {
$post = get_post($att->parent); $post = get_post($att->post_parent);
if ($post instanceof \WP_Post) { if ($post instanceof \WP_Post) {
if ($ThemeHelper->is_post_an_item($post)) { if ($ThemeHelper->is_post_an_item($post)) {
return new \Tainacan\Entities\Item($post); return new \Tainacan\Entities\Item($post);