Viewing 4 replies - 1 through 4 (of 4 total)
  • I know this is an old post, but I’m looking for the same info. thinking about rolling some custom column code. will post back if i make it work

    add_filter( 'manage_edit-page_columns',  'pages_columns'  );
    add_filter( 'manage_edit-page_sortable_columns', 'pages_columns_sortable' ));
    add_filter( 'manage_pages_custom_column',  'pages_column_content'  );
    add_action( 'pre_get_posts',  'pages_orderby' );
    
    function pages_columns($columns){
    	$columns['page_links_to'] = __( 'Page Links To' );
    	return $columns;
    }
    
    function pages_columns_sortable($columns){
    	$columns['page_links_to']='page_links_to';
    	return $columns;
    }
    
    function pages_column_content($column){
    	global $post;
    	switch($column){
    		case 'page_links_to':
    			$meta = get_post_meta($post->ID,'_links_to');
    			echo '<a href="'.$meta[0].'">'.$meta[0].'</a>';
    		break;
    	}
    }
    
    function pages_orderby($query){
    	if( ! is_admin() )
            	return;
    	$orderby = $query->get( 'orderby' );
    	 if( 'page_links_to' == $orderby ) {
    		$query->set('meta_key','_links_to');
    		$query->set('orderby','meta_value');
    	}
    }

    Hi @adrock42,

    Thank you very much! I just discovered this plugin and activated. However, not everything went smoothly. I have encountered a problem.

    Parse error: syntax error, unexpected ‘)’

    Here is the mistake:
    add_filter( 'manage_edit-page_sortable_columns', 'pages_columns_sortable' ));

    Should be:
    add_filter( 'manage_edit-page_sortable_columns', 'pages_columns_sortable' );

    Regards,

    ah, indeed you are correct sir
    cheers

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘See on which posts/pages a link is activated?’ is closed to new replies.