Tagged: ,

This topic contains 1 reply, has 2 voices, and was last updated by  Steve 3 years, 9 months ago.

  • Author
    Posts
  • #5526

    bicho44
    Participant

    HI:

    I have an strange behaivuor with my CPT’s made with piklist.
    Every time i save one post in that CPT the post stays as Draft, and i cannot make it published, unless i do one of this ‘solutions’ 1) Save the post as ‘pending’ and then re-save again as ‘published’ or 2) Using the quick edit i can change the status as ‘published’
    Is not a big deal, but is annoying.

    This is my CPT definition. Maybe there’s a parameter iam missing.

    /**
     * Definir El Custom Post Type
     *
     * @name: Casino
     * @dependencies: Piklist
     */
    add_filter('piklist_post_types', 'casino_post_type');
    
    function casino_post_type($post_types)
    {
        $singular = 'Show';
        $plural = 'Shows';
    
        $post_types['imgd_casino_shows'] = array(
            'labels' => array(
                    'name'               => _x( $plural, 'post type general name', 'imgd' ),
                    'singular_name'      => _x( $singular, 'post type singular name', 'imgd' ),
                    'menu_name'          => _x( $plural, 'admin menu', 'imgd' ),
                    'name_admin_bar'     => _x( $singular, 'add new on admin bar', 'imgd' ),
                    'add_new'            => _x( 'Agregue un '.$singular, 'barco', 'imgd' ),
                    'add_new_item'       => __( 'Agregue un nuevo '.$singular, 'imgd' ),
                    'new_item'           => __( 'Nuevo '.$singular, 'imgd' ),
                    'edit_item'          => __( 'Edite el '.$singular, 'imgd' ),
                    'view_item'          => __( 'Ver '.$singular, 'imgd' ),
                    'all_items'          => __( 'Todos los '.$plural, 'imgd' ),
                    'search_items'       => __( 'Buscar '.$plural, 'imgd' ),
                    'parent_item_colon'  => __( $singular.' Pariente:', 'imgd' ),
                    'not_found'          => __( 'No se encontraron '.$plural, 'imgd' ),
                    'not_found_in_trash' => __( 'No se encontraron '.$plural.' en la Basura.', 'imgd' )
                )
            ,'type' => 'page'
            ,'title' => __('Ingrese un nuevo '.$singular, 'imgd')
            ,'public' => true
            ,'capability_type' => 'page'
            ,'has_archive' => __('shows','imgd')
            ,'menu_icon' => 'dashicons-nametag'
            ,'page_icon' => 'dashicons-nametag'
            ,'rewrite' => array(
                'slug' => __('show', 'imgd')
            )
        ,'supports' => array(
                'title',
                'editor',
                'author',
                'thumbnail'
            )
        ,'menu_position'=>20
        ,'edit_columns' => array(
                'title' => __($plural, 'imgd')
            )
        ,'hide_meta_box' => array(
                'slug'
                ,'author'
                ,'revisions'
                ,'comments'
                ,'mymetabox_revslider_0' // Rev Slider Metabox
                ,'postimagediv' //Feature Image div
                ,'commentstatus'
            )
        );
        return $post_types;
    }

    Any help will be appreciate.

  • #5540

    Steve
    Keymaster

    @bicho44– I tested your code and it worked fine for me. Do you have any Piklist fields assigned to this CPT?

You must be logged in to reply to this topic.