- This topic has 4 replies, 2 voices, and was last updated 7 years, 10 months ago by
mooolen.
-
AuthorPosts
-
-
March 19, 2014 at 2:05 am #1569
mooolenMemberHello,
I have built a custom post type plugin using the following code.
However, only the metabox shows up, the other standard element such as title and content do not. Can you shed some light?/wp-content/plugin/iin_profile.php
`add_filter(‘piklist_post_types’, ‘iin_profile_post_type’);
function iin_profile_post_type($post_types)
{
$post_types[‘iin_profile’] = array(
‘labels’ => piklist(‘post_type_labels’, ‘User Profile’)
,’title’ => __(‘Enter user full name here’)
,’public’ => true
,’rewrite’ => array(
‘slug’ => ‘iin_profile’
)
,’supports’ => array(
‘author’
,’revisions’
,’post_states’ => true
)
,’hide_meta_box’ => array(
‘slug’
,’wpseo_meta’
,’author’
,’revisions’
,’comments’
,’commentstatus’
)
);
return $post_types;
}/wp-content/plugins/iin_profile/iin_profile-metabox.phppiklist(‘field’, array(
‘type’ => ‘text’
,’field’ => ‘text’
,’label’ => ‘Text Box’
,’description’ => ‘Field Description’
,’value’ => ‘Default text’
,’help’ => ‘This is help text.’
,’attributes’ => array(
‘class’ => ‘text’
)
));`piklist(‘field’, array(
‘type’ => ‘select’
,’field’ => ‘select’
,’label’ => ‘Select Box’
,’description’ => ‘Choose from the drop-down.’
,’help’ => ‘This is help text.’
,’attributes’ => array(
‘class’ => ‘text’
)
,’choices’ => array(
‘option1’ => ‘Option 1′
,’option2’ => ‘Option 2′
,’option3’ => ‘Option 3’
)
)); -
March 19, 2014 at 10:23 am #1570
-
March 20, 2014 at 3:20 am #1572
mooolenMemberYes, it works now. Thank you!
Do you have the custom post type components configuration setting documented in your user guide?
I have tried finding it in the user guide or I have missed it somewhere? -
March 20, 2014 at 10:04 am #1575
SteveKeymaster@mooolen– Great. Glad it works now.
The Custom Post Parameters that Piklist has added to register_post_type is documented here >. However, we don’t include the standard WordPress parameters, like
supports, which is what you used. -
March 20, 2014 at 10:54 am #1580
mooolenMemberOk, thanks you for your help!
-
-
AuthorPosts
- You must be logged in to reply to this topic.