Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: post_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
1456                     if ( 'trash' == $post->post_status || !EMPTY_TRASH_DAYS )
1457                          $actions['delete'] = "<a class='submitdelete' title='" . esc_attr(__('Delete this post permanently')) . "' href='" . wp_nonce_url("post.php?action=delete&amp;post=$post->ID", 'delete-post_' . $post->ID) . "'>" . __('Delete Permanently') . "</a>";
1458                }
1459                if ( in_array($post->post_status, array('pending', 'draft')) ) {
1460                     if ( current_user_can('edit_post', $post->ID) )
1461                          $actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('Preview &#8220;%s&#8221;'), $title)) . '" rel="permalink">' . __('Preview') . '</a>';
1462                } elseif ( 'trash' != $post->post_status ) {
1463                     $actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('View &#8220;%s&#8221;'), $title)) . '" rel="permalink">' . __('View') . '</a>';
1464                }
1465                $actions = apply_filters('post_row_actions', $actions, $post);
1466                $action_count = count($actions);
1467                $i = 0;
1468                echo '<div class="row-actions">';
1469                foreach ( $actions as $action => $link ) {
1470                     ++$i;
1471                     ( $i == $action_count ) ? $sep = '' : $sep = ' | ';
1472                     echo "<span class='$action'>$link$sep</span>";
1473                }
1474                echo '</div>';