Tagged: CPT UI, multi domain, multi language, wp_term_taxonomy
- This topic has 8 replies, 2 voices, and was last updated 3 years, 7 months ago by
Steve.
-
AuthorPosts
-
-
June 25, 2018 at 12:36 pm #9083
-
June 25, 2018 at 1:04 pm #9084
-
June 25, 2018 at 3:27 pm #9085
courtensParticipantHi Steve. Thank you so much for all the awesome support. As you may have noticed — through my recent activity on different fronts — I am working on figuring out how to best structure my blog data for a multi language, multi domain blog-add-on to an existing asp website. So far so good, I got my posts lining up: FilmFix Blog. I also got now my Piklist “check box” working.
<?php /* Title: Blog/Post Type Post Type: blog Order: 0 */ piklist('field', array( 'type' => 'group' ,'field' => 'blog_list' ,'label' => __('', 'blog') ,'list' => false ,'fields' => array( array( 'type' => 'select' ,'field' => 'select_com' ,'value' => 'com' ,'choices' => array( 'com' => __('com', 'blog') ,'ch' => __('ch', 'blog') ,'net' => __('net', 'blog') ) ,'columns' => 3 ) ,array( 'type' => 'select' ,'field' => 'select_ser' ,'value' => '8mm' ,'choices' => array( '8' => __('8mm', 'blog') ,'16' => __('16mm', 'blog') ,'slide' => __('slide', 'blog') ,'tape' => __('tape', 'blog') ,'dvd' => __('dvd', 'blog') ,'other' => __('other', 'blog') ) ,'columns' => 4 ) ,array( 'type' => 'select' ,'field' => 'select_l' ,'value' => 'e' ,'choices' => array( 'e' => 'English' ,'g' => 'German' ,'f' => 'French' ) ,'columns' => 3 ) ) ));Note: I did not remove Double Underscores “__” in the code.
I am generating the api data with WordPress, using a defined post type in CPT UI. I was using Custom Fields to generate WordPress taxonomies for the different posts, but decided to switch to Piklist taxonomies instead. How can I get the Piklist taxonomies into the api data? (Before the switch I could see the taxonomy data. Now it is missing…)
I noticed, it looks like the taxonomies are not making it to the
wp_term_taxonomytable, but somehow are getting stored somewhere else!?! However, I do seepiklist_demo_typedata in the table, so somehow I need to figure out how to add new taxonomies to my defined post type.For later: how can I add taxonomy filters to my defined post type list?
Do you suggest I keep each post as it’s own individual post (a new one for each language, to keep pretty permalinks and other WordPress functionalities in place – … and for speed,) and later find a way to cross-link them in the back-end UI? This would be best, I suppose, to link posts and languages linked.
-
June 26, 2018 at 5:17 pm #9086
SteveKeymasterI’m not 100% clear on your question. Piklist taxonomies are essentially WordPress taxonomies with extra options.
If data is not making it the terms table, make sure your code is in the
/termsfolder. -
June 27, 2018 at 3:54 pm #9087
courtensParticipantSomehow I just can’t get control over setting taxonomies to my defined “blog” plug-in (custom post type.)
This doc page helps, but I am missing how-to steps for these lines:
Create a function with your Taxonomy parameters. (example is missing)
Hook it to the piklist_taxonomies filter. (example is missing)This is what I have for my plug-in blog.php file:
<?php /* Plugin Name: Blogs Text Domain: blogs Description: Used to control Taxonomies for Blogs. Text Domain: blogs Domain Path: /blogs */ add_filter('piklist_taxonomies', 'blog_taxonomies'); function blog_taxonomies($taxonomies) { $taxonomies[] = array( 'object_type' => 'ff_language' ,'name' => 'ff_language' ,'configuration' => array( 'hierarchical' => true ,'labels' => piklist('taxonomy_labels', 'Language Selected') ,'show_ui' => true ,'query_var' => true ,'rewrite' => array( 'slug' => 'blog-type' ) ,'show_admin_column' => true ,'list_table_filter' => true ) ); return $taxonomies; }and here is my /meta-box somefile.php file:
<?php /* Title: Blog/Post Type Post Type: blog Order: 0 */ piklist('field', array( 'type' => 'group' ,'field' => 'gr' ,'list' => false ,'fields' => array( array( 'type' => 'select' ,'scope' => 'taxonomy' ,'field' => 'ff_language' ,'choices' => piklist( get_terms('ff_language', array( 'hide_empty' => false )) ,array( 'term_id' ,'name' ) ) ,'columns' => 4 ), array( 'type' => 'select' ,'scope' => 'taxonomy' ,'field' => 'ff_nav' ,'value' => 'other' ,'choices' => array( '8' => '8mm' ,'16' => '16mm' ,'slides' => 'slide' ) ,'columns' => 4 ) ,array( 'type' => 'select' ,'scope' => 'taxonomy' ,'field' => 'ff_domain' ,'value' => 'any' ,'choices' => array( 'any' => 'any' ,'com' => 'only .com' ,'ch' => 'only .ch' ) ,'columns' => 4 ) ));at this point only the first select “pretends” to be linked to a taxonomy; however, making changes to the select is not sticking if clicking on “Save Draft” or “Publish.”
-
June 27, 2018 at 4:36 pm #9088
courtensParticipantI just got it working…
piklist('field', array( 'type' => 'select' ,'scope' => 'taxonomy' ,'field' => 'ff_language' ,'choices' => array( '' => 'Choose Term' ) + piklist(get_terms(array( 'taxonomy' => 'ff_language' ,'hide_empty' => false )) ,array( 'term_id' ,'name' ) ) ,'columns' => 3 ));Thank you for all the support!
-
June 27, 2018 at 7:55 pm #9089
courtensParticipantThis reply has been marked as private. -
June 29, 2018 at 12:27 pm #9097
SteveKeymasterThis reply has been marked as private. -
June 29, 2018 at 12:28 pm #9098
SteveKeymasterGreat! I’m going to close this ticket.
-
-
AuthorPosts
- The topic ‘Double Underscore "__" in Piklist’ is closed to new replies.