Last active
April 26, 2020 15:35
-
-
Save krasenslavov/d71c2ddd21ed36aa837dc8184f60882e to your computer and use it in GitHub Desktop.
Use Bitly to generate short URLs in WordPress. Visit blog post https://bit.ly/2XB3M8s
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 | |
add_action('manage_posts_columns', function($columns) { | |
$columns['bitly_url'] = 'Bitly URL'; | |
return $columns; | |
}, 10, 1); | |
add_action('manage_posts_custom_column', function($column, $post_id) { | |
if ('bitly_url' === $column) { | |
echo get_post_meta($post_id, 'bitly_url', true); | |
} | |
}, 10, 2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment