Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: media_row_actions

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
339           <?php
340           $actions = array();
341           if ( current_user_can('edit_post', $post->ID) )
342                $actions['edit'] = '<a href="' . get_edit_post_link($post->ID, true) . '">' . __('Edit') . '</a>';
343           if ( current_user_can('delete_post', $post->ID) )
344                $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("post.php?action=delete&amp;post=$post->ID", 'delete-post_' . $post->ID) . "' onclick=\"if ( confirm('" . esc_js(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this attachment '%s'\n  'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this attachment '%s'\n  'Cancel' to stop, 'OK' to delete."), $post->post_title )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>";
345           $actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('View &#8220;%s&#8221;'), $title)) . '" rel="permalink">' . __('View') . '</a>';
346           if ( current_user_can('edit_post', $post->ID) )
347                $actions['attach'] = '<a href="#the-list" onclick="findPosts.open(\'media[]\',\''.$post->ID.'\');return false;">'.__('Attach').'</a>';
348           $actions = apply_filters( 'media_row_actions', $actions, $post );
349           $action_count = count($actions);
350           $i = 0;
351           foreach ( $actions as $action => $link ) {
352                ++$i;
353                ( $i == $action_count ) ? $sep = '' : $sep = ' | ';
354                echo "<span class='$action'>$link$sep</span>";
355           } ?>
356           </div></td>
357           <td class="author column-author"><?php $author = get_userdata($post->post_author); echo $author->display_name; ?></td>