Cap checks for pointers. see #19360.

git-svn-id: http://svn.automattic.com/wordpress/trunk@19488 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nacin 2011-11-30 15:59:55 +00:00
parent 880ac093a1
commit 63b2f4c6e7
1 changed files with 12 additions and 0 deletions

View File

@ -1698,6 +1698,18 @@ final class WP_Internal_Pointers {
$pointer = $registered_pointers[ $hook_suffix ];
$caps_required = array(
'wp330_media_uploader' => array( 'upload_files' ),
'wp330_saving_widgets' => array( 'edit_theme_options', 'switch_themes' ),
);
if ( isset( $caps_required[ $pointer ] ) ) {
foreach ( $caps_required[ $pointer ] as $cap ) {
if ( ! current_user_can( $cap ) )
return;
}
}
// Get dismissed pointers
$dismissed = explode( ',', (string) get_user_meta( get_current_user_id(), 'dismissed_wp_pointers', true ) );