Tell me more ×
WordPress Answers is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have created a custom post type, but it just to list some data on a page and it doesn't have any single.php.

How do i disable so on the post page when i click publish it doesn't show the "View Page" link and also how do i disable the "View" link in the columns for that post type.

Thanks

share|improve this question

1 Answer

when adding your custom post types, do something like this,

add_action('init', 'product_register');  

function product_register() {  
    $labels = array(
        'view_item' => null // <--- this part did the trick
    );
    $args = array(  
        'labels' => $labels,  
        'singular_label' => __('Product'),  
        'public' => true,  
        'show_ui' => true,  
        'capability_type' => 'post',  
        'hierarchical' => false,  
        'rewrite' => true,  
        'supports' => array('title', 'editor', 'thumbnail')  
       );  

    register_post_type( 'product' , $args );  
}

more on $labels here http://codex.wordpress.org/Function_Reference/register_post_type#Arguments

share|improve this answer
Didn't seem to work, i fixed it with "post_updated_messages" though.... – Aki Jun 22 '11 at 1:55
maybe I did not get you... ahh... so you mean the one at top too... I did not thought about that... but still the link I gave you had that :) – Reigel Jun 22 '11 at 2:04
3  
@Aki I know this is a while ago, but if you fixed it, might be good to add an answer and accept it yourself. – ZweiBlumen Nov 30 '11 at 13:14

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.