Created
April 4, 2016 18:19
-
-
Save pingram3541/f32f221413a4969e64ff19eef03f5f7e to your computer and use it in GitHub Desktop.
wp dashboard notes - all admin access, not just by user id (lines 211-243, modified lines 15 and 18)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Initialize dashboard notes. | |
* | |
* Get all notes and initialize dashboard widgets. | |
* | |
* @since 1.0.0 | |
*/ | |
public function wpdn_init_dashboard_widget() { | |
$notes = $this->wpdn_get_notes(); | |
foreach ( $notes as $note ) : | |
$note_meta = $this->wpdn_get_note_meta( $note->ID ); | |
//$user = wp_get_current_user(); | |
// Skip if private | |
if ( 'private' == $note_meta['visibility'] && current_user_can( 'manage_options' ) == 0 ) : | |
continue; | |
endif; | |
// Add widget | |
wp_add_dashboard_widget( | |
'note_' . $note->ID, | |
'<span contenteditable="true" class="wpdn-title">' . $note->post_title . '</span><div class="wpdn-edit-title dashicons dashicons-edit"></div><span class="status"></span>', | |
array( $this, 'wpdn_render_dashboard_widget' ), | |
'', | |
$note | |
); | |
endforeach; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment