/** * Initialize the sync process for a document-to-post * * @param $pmp_doc - a CollectionDocJson instance (or null) * @param $wp_post - a WP_Post instance (or null) * @param $parent_syncer - parent of this post/doc */ public function __construct(\Pmp\Sdk\CollectionDocJson $pmp_doc = null, WP_Post $wp_post = null, PmpSyncer $parent_syncer) { parent::__construct($pmp_doc, $wp_post); if ($wp_post && $wp_post->post_parent < 1) { throw new RuntimeException('PmpPost is only for child attachment WP_Posts'); } $this->parent_syncer = $parent_syncer; }
/** * Initialize the sync process for a document-to-post * * @param $pmp_doc - a CollectionDocJson instance (or null) * @param $wp_post - a WP_Post instance (or null) */ public function __construct(\Pmp\Sdk\CollectionDocJson $pmp_doc = null, WP_Post $wp_post = null) { parent::__construct($pmp_doc, $wp_post); if ($wp_post && $wp_post->post_parent > 0) { throw new RuntimeException('PmpPost is only for top-level WP_Posts'); } $this->load_attachment_syncers(); }