Home / Admin / Adds URL to pages window
Duplicate Snippet

Embed Snippet on Your Site

Adds URL to pages window

Code Preview
php
<?php
add_filter('manage_page_posts_columns', 'my_custom_column', 10);
add_action('manage_page_posts_custom_column', 'add_my_custom_column', 10, 2);
function my_custom_column($defaults) {
  $defaults['url'] = 'URL';
  return $defaults;
}
function add_my_custom_column($column_name, $post_id) {
  if ($column_name == 'url') {
      $siteURL=get_site_url($post_id);
      $link= get_permalink( $post_id );
      echo str_replace($siteURL,"",$link);
   }
}

Comments

Add a Comment