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
1449                     $actions['inline hide-if-no-js'] = '<a href="#" class="editinline" title="' . esc_attr(__('Edit this post inline')) . '">' . __('Quick&nbsp;Edit') . '</a>';
1450                     $actions['delete'] = "<a class='submitdelete' title='" . esc_attr(__('Delete this post')) . "' 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 draft '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this post '%s'\n 'Cancel' to stop, 'OK' to delete."), $post->post_title )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>";
1451                }
1452                if ( in_array($post->post_status, array('pending', 'draft')) ) {
1453                     if ( current_user_can('edit_post', $post->ID) )
1454                          $actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('Preview &#8220;%s&#8221;'), $title)) . '" rel="permalink">' . __('Preview') . '</a>';
1455                } else {
1456                     $actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('View &#8220;%s&#8221;'), $title)) . '" rel="permalink">' . __('View') . '</a>';
1457                }
1458                $actions = apply_filters('post_row_actions', $actions, $post);
1459                $action_count = count($actions);
1460                $i = 0;
1461                echo '<div class="row-actions">';
1462                foreach ( $actions as $action => $link ) {
1463                     ++$i;
1464                     ( $i == $action_count ) ? $sep = '' : $sep = ' | ';
1465                     echo "<span class='$action'>$link$sep</span>";
1466                }
1467                echo '</div>';