Tagged: ,

Viewing 5 reply threads
  • Author
    Posts
    • #4427
      cezarion
      Member

      Hello,

      Actually if validation failed on piklist metabox, the post is publishing.
      Did you know how can I prevent this post status and apply an another one.

      Thank’s for your help.

    • #4429
      Steve
      Keymaster

      That shouldn’t happen. Are you sure it’s publishing? Is it already published?

      Please test with the Piklist Demos and see if it’s the same.

      If you are still having an issue please post your code here.

    • #4430
      cezarion
      Member

      I have activate piklist demo, and it’s not publishing; The custom post type have status ‘new’.
      My custom post type are not build with piklist. I used the Themosis Framework to create custom post type.
      Piklist is more advanced in the creation of field in custom metabox.

      But I’m sure the post is publishing.
      Themosis method use a wrapper to create metabox, but it’s the default wordpress custom post type how are defined.

      Does it work on the demonstration because an new custom status is set ?

      Create the custom post type

      PostType::make('media-brand', 'Medias Brands', 'Media brand')->set(array(
          'public'        => true,
          'menu_position' => 10,
          'supports'      => ['title','thumbnail'],
          'rewrite'       => true,
          'query_var'     => false,
          'has_archive'   => false,
          'menu_icon'     => 'dashicons-welcome-view-site'
      ));

      A metabox :

      
      <?php
      /*
      Title: Contents
      Post Type: media-brand, case-study, offer, geographic-universe, contents-universe
      Context: normal
      Order: 2
      Lock: true
      Collapse: false
      */
      
      piklist('field', array(
       'type' => 'textarea'
       ,'field' => 'heading'
       ,'label' => 'Chapeau'
       ,'description' => 'Entrez le chapeau du contenu.'
       ,'attributes' => array(
         'rows' => 10
         ,'cols' => 50
         ,'class' => 'large-text'
       )
       ,'required' => true
       ));
      
      piklist('field', array(
          'type' => 'editor'
          ,'field' => 'description'
          ,'label' => __('Description')
          ,'description' => __('Entrez le contenu.')
          ,'value' => ''
          ,'options' => array (
            'wpautop' => true
            ,'media_buttons' => true
            ,'tabindex' => ''
            ,'editor_css' => ''
            ,'editor_class' => ''
            ,'teeny' => false
            ,'dfw' => false
            ,'tinymce' => true
            ,'quicktags' => true
          )
          ,'required' => true
        ));
      
    • #4432
      Steve
      Keymaster

      @cezarion– We are able to reproduce this issue and are working on a fix.

    • #4433
      cezarion
      Member

      Thank’s a lot.

      You’re plugin is really great. Long ago I had not code with WordPress and that I had not used.
      It is with pleasure that I reuses.

    • #4466
      Steve
      Keymaster

      @cezarion– We added a feature to the latest version of Piklist. Read about it here >

      Let us know if it works for you.

Viewing 5 reply threads
  • You must be logged in to reply to this topic.