Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: page_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
1582                if ( $post->post_status == 'trash' || !EMPTY_TRASH_DAYS )
1583                     $actions['delete'] = "<a class='submitdelete' title='" . esc_attr(__('Delete this page permanently')) . "' href='" . wp_nonce_url("post.php?post_type=$post_type&amp;action=delete&amp;post=$page->ID", 'delete-' . $post->post_type . '_' . $page->ID) . "'>" . __('Delete Permanently') . "</a>";
1584           }
1585           if ( in_array($post->post_status, array('pending', 'draft')) ) {
1586                if ( current_user_can($post_type_object->cap->edit_post, $page->ID) )
1587                     $actions['view'] = '<a href="' . esc_url( add_query_arg( 'preview', 'true', get_permalink($page->ID) ) ) . '" title="' . esc_attr(sprintf(__('Preview &#8220;%s&#8221;'), $title)) . '" rel="permalink">' . __('Preview') . '</a>';
1588           } elseif ( $post->post_status != 'trash' ) {
1589                $actions['view'] = '<a href="' . get_permalink($page->ID) . '" title="' . esc_attr(sprintf(__('View &#8220;%s&#8221;'), $title)) . '" rel="permalink">' . __('View') . '</a>';
1590           }
1591           $actions = apply_filters('page_row_actions', $actions, $page);
1592           $action_count = count($actions);
1593
1594           $i = 0;
1595           echo '<div class="row-actions">';
1596           foreach ( $actions as $action => $link ) {
1597                ++$i;
1598                ( $i == $action_count ) ? $sep = '' : $sep = ' | ';
1599                echo "<span class='$action'>$link$sep</span>";
1600           }