Tagged: Scope and Forms
- This topic has 2 replies, 3 voices, and was last updated 4 years, 9 months ago by
mcmaster.
-
AuthorPosts
-
-
April 25, 2017 at 1:45 pm #7982
openmicParticipantHi Everyone
I am hoping someone can explain were I am going wrong. Really enjoying piklist and everything is working exactly how I wanted it to until I got to the Form part for the front end.To give this in Order, this is the taxonomy that works fine on the back end form.
/** Artist Taxonomy Starts Here */
add_filter( ‘edd_download_category_args’, ‘edd_cat_args’);// add artist taxomomy
if ( ! function_exists( ‘artist_taxonomies’ ) ) {
function artist_taxonomies($taxonomies){
$singular = ‘Artist’;
$plural = ‘Artists’;
$taxonomies[] = array(
‘post_type’ => ‘download’
,’name’ => ‘download_artist’
,’show_admin_column’ => true
,’configuration’ => array(
‘hierarchical’ => false
,’labels’ => get_labels($singular, $plural)
,’hide_meta_box’ => false
,’show_ui’ => true
,’query_var’ => true
,’rewrite’ => array(
‘slug’ => ‘artists’
)
,’capabilities’ => array( ‘manage_terms’ => ‘manage_product_terms’,’edit_terms’ => ‘edit_product_terms’,’assign_terms’ => ‘assign_product_terms’,’delete_terms’ => ‘delete_product_terms’ )
)
);
return $taxonomies;
}
}And This is the form I can’t get to save. According to the Documentation the “scope” should be the saved location in the database which is Terms and Termmeta.
<?php
/*
Title: ARTIST REG
Description: Artists Name and Profile
Taxonomy: download_artist
Post_type: download
Logged in: true
*/
?><?php
piklist(‘field’, array(
‘type’ => ‘text’
,’scope’ => ‘terms’
,’field’ => ‘name’
,’label’ => ‘Artist Name’
,’columns’ => 10
,’description’ => ‘Description goes here’
,’attributes’ => array(
‘class’ => ‘regular-text’
,’placeholder’ => ‘Your Artists or Groups/Bands Name’
)
,’required’ => true
));piklist(‘field’, array(
‘type’ => ‘file’
,’scope’ => ‘termmeta’
,’field’ => ‘upload_media’
,’label’ => ‘Add Photo’
,’description’ => __(‘Description goes here’)
,’options’ => array(
‘modal_title’ => ‘Add Photo’
,’button’ => ‘Add Photo’
)
,’required’ => false
));piklist(‘field’, array(
‘type’ => ‘editor’
,’scope’ => ‘termmeta’
,’field’ => ‘content’
,’label’ => ‘Profile and Bio’
,’description’ => __(‘Description goes here’)
,’options’ => array (
‘wpautop’ => true,
‘media_buttons’ => false,
‘shortcode_buttons’ => false,
‘teeny’ => false,
‘dfw’ => false,
‘quicktags’ => true,
‘drag_drop_upload’ => true,
‘placeholder’ => ‘Your Artists or Groups/Bands Name’,
‘tinymce’ => array(
‘resize’ => true,
‘wp_autoresize_on’ => true)
)
,’required’ => false
));piklist(‘field’, array(
‘type’ => ‘submit’,
‘field’ => ‘submit’,
‘value’ => ‘Add New Artist’
));?>
I am hoping someone can explain what I have missed or am doing wrong as I can’t for the life of me figure it out.Thank You
-
April 27, 2017 at 5:25 pm #8012
JasonKeymasterHey @openmic!
Sorry for the delayed response. Please understand this is a passion project and no one gets paid. We do the best we can, but it’s difficult to keep up. We’re always working to get the community more involved so experienced users can help one another and contribute to make Pklist even better, which is why we recently opened it up on Github.
For your issue, your scopes are incorrect. Change the following:
terms -> taxonomy
termmeta -> term_meta
Hope this helps! 🙂
-
April 27, 2017 at 8:03 pm #8015
-
-
AuthorPosts
- You must be logged in to reply to this topic.