WordPress.org

Ready to get started?Download WordPress

Forums

Custom Post Type - Move to Trash Link Redirecting without query var (3 posts)

  1. bryan_wood
    Member
    Posted 3 years ago #

    Hi all,

    Got a minor issue with custom post types on 2 wp sites, when I click "Move to trash" from the custom post types editing page, the post is moved to the trash but im redirected to the list of posts not the list of my custom post type.

    I've looked through post.php and it's falling through to the default case on the action switch there.

    I'm honestly not sure if I've done something stupid or not :(

    Has anyone else observed the same behaviour? Will post relevant code if this isn't what normally happens.

    Thanks for any advice/direction :)

  2. bryan_wood
    Member
    Posted 3 years ago #

    Here's code/screen caps of what's happening if it helps.

    Code:

    //Custom Post Type Registration in my theme's functions.php init function hook
    
    $labels = array(
        'name' => 'Projects',
        'singular_name' => 'Project',
        'add_new' => 'Add New',
        'add_new_item' => 'Add New Project',
        'edit_item' => 'Edit Project',
        'new_item' => 'New Project',
        'view_item' => 'View Project',
        'search_items' => 'Search Project',
        'not_found' =>  'No Projects Found',
        'not_found_in_trash' => 'No Projects Found in Trash',
        'parent_item_colon' => '',
        'menu_name' => 'Projects'
    
      );
      $args = array(
        'labels' => $labels,
        'public' => true,
        'publicly_queryable' => true,
        'show_ui' => true,
        'show_in_menu' => true,
        'query_var' => true,
           'rewrite' => array('slug'=>'projects'),
        'capability_type' => 'post',
        'has_archive' => true,
        'hierarchical' => false,
        'menu_position' => null,
        'supports' => array('title','editor','thumbnail')
      );
      register_post_type('aureate_project',$args);
    
    // This is the redirect being used
    
    // wp-admin/post.php Line: 271
    default:
    	wp_redirect( admin_url('edit.php') );
    	exit();
    	break;

    Screencaps:

  3. bryan_wood
    Member
    Posted 3 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic