Skip to content
This repository was archived by the owner on Jul 28, 2024. It is now read-only.
This repository was archived by the owner on Jul 28, 2024. It is now read-only.

List supported entities, their actions and VP tags #804

@borekb

Description

@borekb

So far, we didn't really need programmatic access to a list of entities and what actions and VP tags they support. The best we had were PhpDoc comments like this:

/**
 * Post changes.
 *
 * VP tags:
 *
 *     VP-Action: post/(create|edit|delete|trash|untrash|draft|publish)/VPID
 *     VP-Post-Title: Hello world
 *     VP-Post-Type: (post|page)
 *     VP-Post-UpdatedProperties: post_title,post_content,post_status
 */
class PostChangeInfo extends EntityChangeInfo {
    ...
}

However, since the tags can be searched for since #586, we need to at least document what the valid search keywords are, and better, provide auto-completion or some sort of GUI for that in the future. Maintaining this manually would be a pain so the goal of this ticket is to create a mechanism to get the list of all the possible entities and their actions / tags programmatically.

Note: We might be moving away from ChangeInfo and deep object hierarchies to something simpler in v4 or v5 (UPDATE: we now have a ticket for this, #1034) so this ticket might be revisited later. However, the idea stays.

Metadata

Metadata

Assignees

Labels

duplicateEither a direct duplicate or will be better resolved by another issueimprovementImprovement of an existing functionality. See "feature" for new features.scope: coreCore VersionPress functionality like tracking actions, creating Git commits, etc.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions