بنقرة واحدة
action-links
// Guides implementation of structured action links on log events. Use when adding get_action_links() to a logger or migrating from get_log_row_details_output().
// Guides implementation of structured action links on log events. Use when adding get_action_links() to a logger or migrating from get_log_row_details_output().
Writes blog posts for simple-history.com matching the author's voice and style. Use when drafting posts, announcements, or marketing copy.
How to design and regenerate marketing screenshots for the wordpress.org plugin page (banner-1544x500.png, screenshot-1.png, etc). Covers the event mix that converts, the reproducible WordPress Playground pipeline that bakes it, and every non-obvious gotcha from previous shoots. Use when refreshing screenshot-1.png, banners, or any image showing the Simple History event log.
Query Google Analytics (GA4) for simple-history.com traffic, top pages, referrers, and the premium_* UTM campaigns that tag admin links. Use when the user asks about visits, traffic sources, which admin links lead to the site, upsell click-through, or campaign performance.
Adds changelog entries to readme.txt following keepachangelog format. Use when updating the Unreleased section or documenting changes for a release.
Guidance for writing and running tests in Simple History. Covers which framework to use, how to run existing tests, and how to create new ones (including the codegen recording workflow).
Surface and triage local issues that are safe and quick for an AI to implement and easy for a human to verify. Use when the user wants to "knock out issues", asks for "quick wins", "low-hanging fruit", "what's easy to do right now", or wants a batch of small tasks to work through in one session.
| name | action-links |
| description | Guides implementation of structured action links on log events. Use when adding get_action_links() to a logger or migrating from get_log_row_details_output(). |
| allowed-tools | Read, Grep, Glob |
Structured navigational links rendered below log events. Added in 5.24.0.
Icons represent action type, not destination. Use a small, consistent icon vocabulary so users learn the pattern once. The label text describes where the link goes — the icon just reinforces what kind of action it is.
Use only these five types. Do not invent new ones unless truly necessary.
| Action | Icon | When to use |
|---|---|---|
view | Eye (visibility) | Navigate to see/inspect something |
edit | Pencil | Navigate to modify something |
preview | Preview | View a draft or unpublished item |
revisions | History clock | Compare versions or view change history |
details | Info | Open the event details modal (auto-appended via Logger::event_has_more_details()) |
Most links are view. When in doubt, use view. Don't return details from get_action_links() directly — opt in via event_has_more_details() instead so the modal-link wiring stays consistent.
event_has_more_details() returns string|false: the label to render (e.g. __( 'Show error message', ... )), or false to skip. Pick a label that names the actual payload (Show error message, Show all 47 roles) rather than a generic Show details — the icon already signals "more info", the label should sell what's behind it.
Verify the payload exists before returning a label. A logger opted into this should still inspect $row->context and return false when the relevant keys are missing — otherwise older events without the payload would lead users to a modal with nothing extra. Match on both the message key and the presence of the data.
Override get_action_links() in your logger class. Always check capabilities.
public function get_action_links( $row ) {
if ( ! current_user_can( 'required_capability' ) ) {
return [];
}
return [
[
'url' => admin_url( 'page.php' ),
'label' => __( 'View thing', 'simple-history' ),
'action' => 'view',
],
];
}
Each link must have all three keys:
url — Full URL (use admin_url(), get_edit_post_link(), etc.)label — Translated, human-readable textaction — One of: view, edit, preview, revisionsReturn multiple links when relevant. Order: edit first, then view, then others.
$action_links = [];
if ( current_user_can( 'edit_post', $post_id ) ) {
$action_links[] = [
'url' => get_edit_post_link( $post_id, 'raw' ),
'label' => __( 'Edit post', 'simple-history' ),
'action' => 'edit',
];
}
if ( get_post_status( $post_id ) === 'publish' ) {
$action_links[] = [
'url' => get_permalink( $post_id ),
'label' => __( 'View post', 'simple-history' ),
'action' => 'view',
];
}
return $action_links;
When moving a link from get_log_row_details_output() to action links:
get_action_links() with the link<a> HTML from get_log_row_details_output()Common inline links to migrate: "View/Edit" comment links, "View plugin info" thickbox links, post edit links embedded in detail tables. These are all navigational — they belong here, not in Event Details.
key).Helpers::experimental_features_is_enabled()).REST Controller (prepare_item_for_response)
→ Simple_History::get_action_links($row)
→ Logger::get_action_links($row)
→ filter: simple_history/get_action_links
→ REST response (action_links field)
→ EventActionLinks.jsx renders with icons
| File | Role |
|---|---|
loggers/class-logger.php | Base class, default empty get_action_links() |
inc/class-simple-history.php | Routes to logger, applies filter |
inc/class-wp-rest-events-controller.php | REST schema and response |
src/components/EventActionLinks.jsx | Frontend rendering with icons |
css/styles.css | Icon mask-image rules for action links |
Only if the four standard types truly don't fit:
css/icons/ (Material Symbols, 48px, FILL0, wght400)css/styles.css under the action links sectionACTION_ICONS in src/components/EventActionLinks.jsxloggers/class-site-health-logger.php — single view linkloggers/class-available-updates-logger.php — single view linkloggers/class-post-logger.php — edit, view, preview, revisions