Created
April 8, 2016 14:44
-
-
Save Jany-M/d7aad88ea27e69213956cf375e7490ac to your computer and use it in GitHub Desktop.
[WordPress] View link opens Post in a new Tab
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Custom View in action row | |
function change_post_row_actions( $actions, $post ) { | |
unset( $actions['view'] ); | |
$actions['view'] .= '<a href="'.get_the_permalink($post->ID).'" target="_blank">View</a>'; | |
return $actions; | |
} | |
add_filter( 'post_row_actions', 'change_post_row_actions', 10, 2 ); | |
add_filter( 'page_row_actions', 'change_post_row_actions', 10, 2 ); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment