Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • ozzierod

    (@ozzierod)

    Did you ever find a solution to this?

    ozzierod

    (@ozzierod)

    Probably a better way but here’s my hack.

    Edit wp-admin/includes/class-wp-posts-list-table.php – single_row function
    There’s a switch statement in that class that lists ‘title’ as a case.

    Copy the ‘title’. In my situation, my custom page type is not hierarchical so i removed that if statement. Replace the $title’s with your custom field and voila!

    Here’s my modified case

    case 'location_name':
    					$attributes = 'class="post-title page-title column-title"' . $style;
    ?>
    			<td <?php echo $attributes ?>><strong><?php if ( $can_edit_post && $post->post_status != 'trash' ) { ?><a class="row-title" href="<?php echo $edit_link; ?>" title="<?php echo esc_attr( sprintf( __( 'Edit “%s”' ), get_post_meta($post->ID, "location_name", true) ) ); ?>"><?php echo get_post_meta($post->ID, "location_name", true) ?></a><?php } else { echo $title; }; _post_states( $post ); ?></strong>
    <?php
    					if ( 'excerpt' == $mode ) {
    						the_excerpt();
    					}
    
    				$actions = array();
    				if ( $can_edit_post && 'trash' != $post->post_status ) {
    					$actions['edit'] = '<a href="' . get_edit_post_link( $post->ID, true ) . '" title="' . esc_attr( __( 'Edit this item' ) ) . '">' . __( 'Edit' ) . '</a>';
    					$actions['inline hide-if-no-js'] = '<a href="#" class="editinline" title="' . esc_attr( __( 'Edit this item inline' ) ) . '">' . __( 'Quick&nbsp;Edit' ) . '</a>';
    				}
    				if ( current_user_can( $post_type_object->cap->delete_post, $post->ID ) ) {
    					if ( 'trash' == $post->post_status )
    						$actions['untrash'] = "<a title='" . esc_attr( __( 'Restore this item from the Trash' ) ) . "' href='" . wp_nonce_url( admin_url( sprintf( $post_type_object->_edit_link . '&action=untrash', $post->ID ) ), 'untrash-' . $post->post_type . '_' . $post->ID ) . "'>" . __( 'Restore' ) . "</a>";
    					elseif ( EMPTY_TRASH_DAYS )
    						$actions['trash'] = "<a class='submitdelete' title='" . esc_attr( __( 'Move this item to the Trash' ) ) . "' href='" . get_delete_post_link( $post->ID ) . "'>" . __( 'Trash' ) . "</a>";
    					if ( 'trash' == $post->post_status || !EMPTY_TRASH_DAYS )
    						$actions['delete'] = "<a class='submitdelete' title='" . esc_attr( __( 'Delete this item permanently' ) ) . "' href='" . get_delete_post_link( $post->ID, '', true ) . "'>" . __( 'Delete Permanently' ) . "</a>";
    				}
    				if ( in_array( $post->post_status, array( 'pending', 'draft' ) ) ) {
    					if ( $can_edit_post )
    						$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>';
    				} elseif ( 'trash' != $post->post_status ) {
    					$actions['view'] = '<a href="' . get_permalink( $post->ID ) . '" title="' . esc_attr( sprintf( __( 'View “%s”' ), $title ) ) . '" rel="permalink">' . __( 'View' ) . '</a>';
    				}
    
    				$actions = apply_filters( is_post_type_hierarchical( $post->post_type ) ? 'page_row_actions' : 'post_row_actions', $actions, $post );
    				echo $this->row_actions( $actions );
    
    				get_inline_data( $post );
    				echo '</td>';
    			break;

    ozzierod

    (@ozzierod)

    I have the same problem. Ever find out how to fix it?

Viewing 3 replies - 1 through 3 (of 3 total)