- This topic has 6 replies, 2 voices, and was last updated 6 years, 2 months ago by
irene.
-
AuthorPosts
-
-
November 4, 2015 at 12:20 pm #4859
ireneMemberHello,
For my plugin, which function is just to input data (names, birthdates), but with the possibility of taxanomies and relations.
I am wondering if it is possible to hook, or call in, an cpt and all the metaboxes, etc. created with Piklist in an new, and thus blanco admin page.
If so, how can I accomplish this? Would be very grateful… Just can not figure this one out by myself 🙂
Thanks in advance,
Irene -
November 4, 2015 at 11:29 pm #4872
-
November 5, 2015 at 6:57 am #4877
ireneMemberHallo Steve,
What I would like to do is:
Create a custom post type with show_ui => false with piklist (have already done that), create a new admin page (blanco) with menu on top level and create a custom edit post page for this cpt.
I would like to have the user post layout, tried using the user post at first but I just want to input dog names, b-day etc… for later use, no need for log-in, password, e-mail etc…Recapitulating:
Is there is a way where i can create my own edit.php page from scratch for my custom post type with the use of Piklist?
I Understand I need to create a cpt and set show_ui to false and construct an interface for the CPT just as for an plugin admin page. But I do not understand how I can than refer to the cpt inside this admin page, make the metaboxes and workflow’s appear on this new admin page and save the meta data to the cpt….Very Grateful if you could help me…
Irene
-
November 5, 2015 at 5:08 pm #4884
SteveKeymaster@irene– There are two ways to do this in Piklist:
1) The piklist function can work in any file, so you can use this outside the /parts/ folder:piklist('field', array( 'type' => 'text' ,'field' => 'text' ,'label' => __('Text', 'piklist-demo') ,'help' => __('You can easily add tooltips to your fields with the help parameter.', 'piklist-demo') ,'attributes' => array( 'class' => 'regular-text' ) ));2) In the latest Beta, you can use a Piklist form. Take a look at these two files:
–The form.
–Embedding the formYou can get the latest beta here>
Let us know if you need any help with this.
-
November 11, 2015 at 6:28 pm #4932
ireneMemberHello Steve,
Thanks for answering my question.
I have downloaded the new beta and have read and looked at the code, but, maybe I have overlooked it or just because I am new to developing, I can not find a piece of code where I can refer to my custom post type on a blanc Admin page.
If I place a form on the blanc admin page how can I then save the data to the correct custom post type (dog in my case), or is it not necessary to save to a particular post type to be able to make for example a profile page…, and relations (parent, children…) -
November 12, 2015 at 12:00 pm #4944
SteveKeymasterIn the latest beta take a look at this file:
wp-content/plugins/piklist/add-ons/piklist-demos/parts/forms/new-post-with-validation.phpThis is a form that creates a new post. You’ll notice the first field is hidden but sets the post_type to piklist_demo. You would just change that to dog.
piklist('field', array( 'type' => 'hidden' ,'scope' => 'post' ,'field' => 'post_type' ,'value' => 'dog' ));To include this form in your admin-page, you would use this code:
piklist('form', array( 'form' => 'new-post-with-validation' // name of the file without .php ));Does that make sense?
-
November 12, 2015 at 6:43 pm #4953
ireneMemberSteve: 🙂
Thank you!!!!!
Got it! Now figure out the rest 🙂Irene
-
-
AuthorPosts
- The topic ‘Is it possible to hook a cpt to a custom admin page with piklist’ is closed to new replies.