Viewing 6 reply threads
  • Author
    Posts
    • #1793
      s1r0n
      Member

      I am trying to create a custom post. Code is below. Everything seems to work except the post edit box and title box doesn’t show up. The custom status appear though. which is weird. am I missing something in this code?

      add_filter('piklist_post_types', 'my_custom_posts');
      function my_custom_posts() {
      
          $post_types['articles'] = array(
          'post_states' => true
          ,'labels' => piklist('post_type_labels', 'Articles')
          ,'title' => __('Articles')
          ,'public' => true
          ,'rewrite' => array(
            'slug' => 'articles'
          )
          ,'capability_type' => 'post'
          ,'edit_columns' => array(
           'title' => __('Article Title')
           ,'author' => __('Author')
         )
          ,'supports' => array(
            'author'
            ,'revisions'
          )
          ,'hide_meta_box' => array(
            'slug'
            ,'comments'
            ,'commentstatus'
          )
          ,'status' => array(
              'draft' => array(
                'label' => 'New'
              )
              ,'submittoeditor' => array(
                'label' => 'Submit to Editor'
              )
              ,'openforreview' => array(
                'label' => 'Open for Review'
              )
              ,'published' => array(
                'label' => 'Published'
              )
              ,'rejected' => array(
                'label' => 'Rejected'
              )
            )
        );
    • #1794
      s1r0n
      Member

      I’m guessing this has to do with the overlay glitch I posted on as well. when you look at the source it seems to be all there, but its just not rendering in the browser

    • #1796
      Steve
      Keymaster

      You’re only supporting author and revisions here:

      ,'supports' => array(
            'author'
            ,'revisions'
          )

      If you want title and editor you need to declare it like this:

      ,'supports' => array(
            'author'
            ,'revisions'
            ,'title'
            ,'editor'
          )

      Or not use the supports parameter at all to get the WordPress defaults.

    • #1797
      s1r0n
      Member

      that fixed it up. i’m still not getting the author field though. so I can’t select an appropriate author for the article

    • #1798
      s1r0n
      Member

      i’m also not able to get the comments either

    • #1799
      Steve
      Keymaster

      AUTHOR
      I just tested this code and I’m getting the author box, so check the Screen Options at the top of the page and make sure it’s there.

      COMMENTS
      Make sure they are added to the support parameter, and remove them from here:

      ,'hide_meta_box' => array(
            'slug'
            ,'comments'
            ,'commentstatus'
          )
    • #1800
      s1r0n
      Member

      that did the trick.

      you folks have a rockin plugin here. I love this

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