WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )
apply_filters( "hook_name", "what_to_filter" )
.Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
Line | Code |
---|---|
1360 | if ( 'trash' == $post->post_status || !EMPTY_TRASH_DAYS ) |
1361 | $actions['delete'] = "<a class='submitdelete' title='" . esc_attr(__('Delete this item permanently')) . "' href='" . get_delete_post_link($post->ID, '', true) . "'>" . __('Delete Permanently') . "</a>"; |
1362 | } |
1363 | if ( in_array($post->post_status, array('pending', 'draft')) ) { |
1364 | if ( current_user_can($post_type_object->cap->edit_post, $post->ID) ) |
1365 | $actions['view'] = '<a href="' . esc_url( add_query_arg( 'preview', 'true', get_permalink($post->ID) ) ) . '" title="' . esc_attr(sprintf(__('Preview “%s”'), $title)) . '" rel="permalink">' . __('Preview') . '</a>'; |
1366 | } elseif ( 'trash' != $post->post_status ) { |
1367 | $actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('View “%s”'), $title)) . '" rel="permalink">' . __('View') . '</a>'; |
1368 | } |
1369 | $actions = apply_filters('post_row_actions', $actions, $post); |
1370 | $action_count = count($actions); |
1371 | $i = 0; |
1372 | echo '<div class="row-actions">'; |
1373 | foreach ( $actions as $action => $link ) { |
1374 | ++$i; |
1375 | ( $i == $action_count ) ? $sep = '' : $sep = ' | '; |
1376 | echo "<span class='$action'>$link$sep</span>"; |
1377 | } |
1378 | echo '</div>'; |