Make WordPress Core

Changeset 19488


Ignore:
Timestamp:
11/30/2011 03:59:55 PM (13 years ago)
Author:
nacin
Message:

Cap checks for pointers. see #19360.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/template.php

    r19466 r19488  
    16991699        $pointer = $registered_pointers[ $hook_suffix ];
    17001700
     1701        $caps_required = array(
     1702            'wp330_media_uploader' => array( 'upload_files' ),
     1703            'wp330_saving_widgets' => array( 'edit_theme_options', 'switch_themes' ),
     1704        );
     1705
     1706        if ( isset( $caps_required[ $pointer ] ) ) {
     1707            foreach ( $caps_required[ $pointer ] as $cap ) {
     1708                if ( ! current_user_can( $cap ) )
     1709                    return;
     1710            }
     1711        }
     1712
    17011713        // Get dismissed pointers
    17021714        $dismissed = explode( ',', (string) get_user_meta( get_current_user_id(), 'dismissed_wp_pointers', true ) );
Note: See TracChangeset for help on using the changeset viewer.