Tagged: , ,

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

  • Author
    Posts
  • #7775

    solace
    Participant

    Hi,

    I’d like to be able to create a Dashboard QuickPress/Add New Post widget equivalent for a CPT that I have created with Piklist.

    From the looks of it I’ll need to create a forms/ part for the form, and use a shortcode in a dashboard/ part to load it. Is this correct?

    I essentially want it to be handled in the same way as a standard Add New post submission where it submits to post-new.php, only from a widget, which means I’ll need the standard hidden fields that are populated on the standard form (ie. nonce, user-id, post-author etc). Is there a quick way to build these or do I need invoke field() for each?

    I’ve gotten as far as:

    /*
    Action: post-new.php
    Capability: edit_posts
    Network: false
    */
    
    piklist( 'field', array(
      'type'    => 'text',
      'field'   => 'post_title',
      'scope'   => 'post',
      'label'   => 'Title'
    ) );
    
    <the same custom fields I have in my CPT metaboxes>
    
    piklist('field', array(
      'type' => 'submit',
      'field' => 'submit',
      'value' => 'Submit'
    ));

    My apologies if I have missed the documentation for this somewhere.

    Thanks

  • #7782

    Steve
    Keymaster

    @solace– You got it right. Build a FORM, and use the auto-generated Shortcode to but in the Dashboard widget.

  • #7783

    solace
    Participant

    Hi Steve,

    Thanks. And to confirm, I need to create a field() for each of standard hidden fields manually? No shortcut for this?

    Thanks

  • #7784

    Steve
    Keymaster

    That’s correct. Use this as a guide >

    You can just copy and paste.

You must be logged in to reply to this topic.