Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions tests/PostTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,18 @@ public function test_registers_a_private_exportable_activity_post_type() {
$this->assertSame( 'do_not_allow', wp_user_activity_meta_caps( array(), 'create_activities' )[0] );
}

/**
* Legacy page checks must resolve to the same permission as activity edits.
*/
public function test_edit_page_capability_is_defined_for_activity_posts() {
$GLOBALS['wpuat_test'] = array();

wp_user_activity_register_post_types();

$call = $GLOBALS['wpuat_test']['calls']['register_post_type'][0];
$this->assertSame( 'list_users', $call[1]['capabilities']['edit_page'] );
}

public function test_prepends_the_activity_action_to_activity_content() {
$GLOBALS['wpuat_test'] = array();
$post = new WP_Post();
Expand Down
2 changes: 2 additions & 0 deletions wp-user-activity/includes/post-types.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ function wp_user_activity_get_post_type_args() {

// Meta caps
'edit_post' => 'edit_activity',
// WordPress may check this legacy alias against an activity post.
'edit_page' => 'list_users',
'read_post' => 'read_activity',
'delete_post' => 'delete_activity',

Expand Down
Loading