/** * Used by meta-entity storages as a performance optimalization. * For example EntityChangeInfo representing change in postmeta returns VPID of the related post. * * @return string|null */ public function getParentId() { if ($this->entityInfo->parentReference) { $tagContainingParentId = $this->actionsInfo->getTagContainingParentId(); return $this->getCustomTags()[$tagContainingParentId]; } return null; }
/** * @test */ public function actionsInfoAppliesFilterOnDescription() { $actions = ['some-action' => ['message' => 'Some description']]; add_filter('vp_action_description_some-scope', function ($description) { $this->assertSame('Some description', $description); return 'Filtered description'; }); $actionsInfo = new ActionsInfo('some-scope', $actions); $description = $actionsInfo->getDescription('some-action', 'some-id', []); $this->assertSame('Filtered description', $description); }
public function getPriority() { return $this->actionsInfo->getActionPriority($this->getAction()); }