Custom Post Type Display and works but But Blank Quick Edit

Question

I have a mystery problem. I have successfully created a custom post type, with associated categories. BUT, when I list the posts, the QuickEdit section does not display the title, date or any information. It is blank and I don’t know why. Can anyone see the problem?

//////////////////////// setup admin pages
add_action( 'init', 'mmd_client_tracking_form', 0 );                            // Add the menu
function mmd_client_tracking_form()
{
  $labels = array(
    'name'               => _x( 'Review Client Workouts', 'mmd_client_list' ),
    'singular_name'      => _x( 'Manage Clients', 'mmd_client_list' ),
    'add_new'            => _x( 'New Client', 'mmd_client_list' ),
    'add_new_item'       => __( 'Add New Client' ),
    'edit_item'          => __( 'Edit Client' ),
    'new_item'           => __( 'New Client' ),
    'all_items'          => __( 'Workout Clients' ),
    'view_item'          => __( 'View Client' ),
    'search_items'       => __( 'Search Clients' ),
    'not_found'          => __( 'No Clients found' ),
    'not_found_in_trash' => __( 'No Clients found in the Trash' ), 
    'parent_item_colon'  => '',
    'menu_name'          => 'Biorider Tracking'
  );


  $args = array(
    'register_meta_box_cb' => 'mmdtrack_meta_box', // Register a meta box
    'labels'               => $labels,
    'description'          => 'This post type holds all posts for your directory items.',
    'public'               => true,
    'menu_position'        => 10,
    'show_ui'              => true,
    'supports'             => array( 'title' ),
    'has_archive'          => true,
    'menu_icon'            => 'dashicons-media-spreadsheet',
  );
  register_post_type( 'mmdtrack', $args );  

}


//-----------------------------------------------------------------
// CUSTOM CATAGORY
//-----------------------------------------------------------------
add_action( 'init', 'mmd_track_taxonomies', 0 );                                  // Add the standard submenu
function mmd_track_taxonomies() {

  $labels = array(
        'name'              => _x( 'Biorider Categories', 'Biorider Categories' ),
        'singular_name'     => _x( 'Category', 'taxonomy singular name' ),
        'search_items'      => __( 'Search Clients Categories' ),
        'all_items'         => __( 'All Clients Categories' ),
        'parent_item'       => __( 'Parent Clients Categories' ),
        'parent_item_colon' => __( 'Parent Clients Category:' ),
        'edit_item'         => __( 'Edit Clients Category' ),
        'update_item'       => __( 'Update Clients Category' ),
        'add_new_item'      => __( 'Add New Clients Category' ),
        'new_item_name'     => __( 'New Clients Category Name' ),
        'menu_name'         => __( 'Clients Categories')
  );
  $args = array(
        'hierarchical'      => true,
        'labels'            => $labels,
        'show_ui'           => true,
        'show_admin_column' => true,
        'query_var'         => true,
        'rewrite'           => array( 'slug' => 'mmdtrack_cat' )
  );

  register_taxonomy( 'mmdtrack_cat', 'mmdtrack', $args );
}

add_action( 'init', 'mmd_tracking_menu', 0 );                                          // Add the standard submenu
function mmd_tracking_menu()
{

add_submenu_page('edit.php?post_type=mmdtrack',   // Parent Slug from add_menu_page 
                 'Biorider Settings',             // Title of page
                 'Settings',                      // Menu title
                 'manage_options',                // Minimum capability to view the menu.
                 'mmd_Tracking_Settings_slug',    // Unqiue Slug Name
                 'mmd_trackingAdminPage' );    // A callback function used to display page content. 

}





//-----------------------------------------------------------------
// ENTRIES OF MEMBER LISTINGS - MANUAL
//-----------------------------------------------------------------
function mmdtrack_meta_box(WP_Post $post)
 { 
 $prefix = 'mmdtrack';                               // Custom Post Name    
 add_meta_box($prefix, 'Set Tracking', mmdtrack_client_tracking_form);  
 }

function  mmdtrack_client_tracking_form($PostId)
{
... displaying code for metabox
}



////////////////////////////////////////////////////////////////////////
//  THIS HOOKS IN TO WORDPRESS CUSTOM POST AND CHANGES THE 
//  MANAGE LIST FORM
//////////////////////////////////////////////////////////////////////
add_filter('manage_mmdtrack_posts_columns', 'mmd_member_track_columns_head');
function mmd_member_track_columns_head($defaults) {

    $new_columns['cb'] = '<input type="checkbox" />';
    $new_columns['mmd_member_name']                    = 'Name';
    $new_columns['mmd_member_tracking_workout_count']  = 'Number of Workouts';
    $new_columns['mmd_member_memberships']             = 'Active Membershps';
    $new_columns['mmd_member_category']                = 'Categories';

    return $new_columns;
}



add_action('manage_mmdtrack_posts_custom_column', 'mmd_track_columns_content', 10, 2);
function mmd_track_columns_content($column_name, $post_ID)
{

switch($column_name)
 {  
  case 'mmd_member_name': 
      $Name  = get_the_title( $post_ID );
      echo $Name;
  break;

  case 'mmd_member_tracking_workout_count':
     $user_ID = mmd_track_FindUser($post_ID);
     echo mmd_track_GetWorkoutCnt($user_ID);
  break;

   case 'mmd_member_memberships':
     $user_ID = mmd_track_FindUser($post_ID);
     if($user_ID==0)
       echo "None";
  break;

  case 'mmd_member_category':
    $terms = get_the_terms( $post_ID, 'mmdtrack_cat' );

    /* If terms were found. */
    if ( !empty( $terms ) ) 
        {
        $out = array();

        /* Loop through each term, linking to the 'edit posts' page for the specific term. */
        foreach ( $terms as $term ) 
           {
           $out[] = sprintf( '<a href="%s">%s</a>',
                    esc_url( add_query_arg( array( 'post_type' => 'mmdtrack', 'mmdtrack_cat' => $term->slug ), 'edit.php' ) ),
                    esc_html( sanitize_term_field( 'name', $term->name, $term->term_id, 'mmdtrack_cat', 'display' ) )
                           );
           }

         /* Join the terms, separating them with a comma. */
         echo join( ', ', $out );
        }

  break;        

 }
}






function mmd_track_emptytrash($post_ID)
{
if(get_post_status( $post_id ) === 'trash') 
  ClearMemberWorkouts($post_ID);

return 0;       
}
add_action( 'before_delete_post', 'mmd_track_emptytrash');

////////////////////////////////////////////////////////////
//  If a list is trashed, make sure all the list records are
//  removed from the table.
////////////////////////////////////////////////////////////
function mmd_track_place_in_trash($post_ID)
{
}
add_action('wp_trash_post', 'mmd_track_place_in_trash');



0
Debbie Kurth 1 year 0 Answers 108 views 0

Leave an answer