Skip to content

Instantly share code, notes, and snippets.

Created August 2, 2012 17:40
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Download Monitor Plugin Extension - Inline Edit Button
//name: dlmEdit
//description: adds edit link for downloads
//format: [dlmEdit id=""]
//required parameters: id
add_shortcode('dlm_edit_link', 'dlm_edit_link');
function dlm_edit_link($atts, $content = null) {
"id" => '',
), $atts));
if ( current_user_can('user_can_edit_downloads') )
$output = '<a href="http://'.$_SERVER['HTTP_HOST'].'/wp-admin/admin.php?page=download-monitor/wp-download_monitor.php&action=edit&id='.$id.'&sort=title&p=1" class="dlmEdit">[edit]</a>';
$output = '';
return $output;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment