Forum Replies Created
-
AuthorPosts
-
May 3, 2018 at 10:15 AM in reply to: cloneable oEmbed fields doesn't save empty data as "NULL" #9435
foundbutlost
ParticipantI think it's all good and working fine now. Thank you for the update and thread closed!
foundbutlost
ParticipantHi, i didnt see any update on my account dashboard. you talking about MB Custom Table Extension right?
April 25, 2018 at 9:43 AM in reply to: How to filter value of spesific field before saving it to DB #9365foundbutlost
ParticipantYes now it's become very clear. i actually trying to input youtube url on oEmbed field but i only want save its video ID when it goes to database so i can save more space but still be able to see the video preview below the oEmbed field using thereverse filter
rwmb_fieldID_field_meta.Thank you so much and case closed!
April 24, 2018 at 5:51 PM in reply to: How to filter value of spesific field before saving it to DB #9354foundbutlost
ParticipantI tried this after found this thread https://support.metabox.io/topic/woocommerce-prdoucts-image-gallery-with-metabox-image-fields/#post-7904
add_filter( 'rwmb_meta_boxes', 'my_meta2_box' ); function my_meta2_box( $meta_boxes ) { $meta_boxes[] = array ( 'title' => 'Meta song', 'table' => 'wp_xxxx', 'storage_type' => 'custom_table', 'post_types' => array ( 'post', ), 'context' => 'form_top', 'priority' => 'high', 'status' => 'publish', 'autosave' => false, 'fields' => array ( array ( 'id' => 'my_field_id',.... add_filter( 'rwmb_my_field_id_value', function ( $value ) { $value = 'it works'; return $value; } );but it doesnt work, welp 🙁
April 24, 2018 at 2:00 PM in reply to: How to filter value of spesific field before saving it to DB #9350foundbutlost
ParticipantAh silly me, how could i've missed that :'D, but still i'm not too familiar with the code explanation.
$new = apply_filters( "rwmb_{$field['id']}_value", $new, $field, $old );Where do i put this code? how come even i have $old when i have nothing as i'm inserting a new data? which variable holding this value “this is my value”? because i need to do str replace on it.
i'm really confused, usually when i want to change output of plugin i just simply use add filter and a function like this:
add_filter( 'the_content', 'filter_my_content' ); function filter_my_content( $content ) { some code here }please help me
foundbutlost
ParticipantYep, actually i'm currently using that right now. Thank you and closed!
April 24, 2018 at 10:59 AM in reply to: Prevent terms order being overwritten when updating post #9345foundbutlost
ParticipantYes, I'm sorry if i dont make it clear enough for you. i thought i can achieve it using meta box taxonomy fields because on MB Custom Taxonomy, user allowed to set the sort parameter when creating custom taxonomy so i thoght it will integrate itself with meta box taxonomy fields when i set it to true.
April 24, 2018 at 9:50 AM in reply to: Prevent terms order being overwritten when updating post #9342foundbutlost
ParticipantCurrently I'm using wordpress default Tags taxonomy, it's nothing to do with metabox. here's the code:
function my_sort_tags() { global $wp_taxonomies; $wp_taxonomies['post_tag']->sort = true; } add_action( 'init', 'my_sort_tags' );Then if i insert my terms on default wordpress taxonomy fields, it will remember the order when saving it to the database but not showing it in order when retrieve it from database to be showed on the editor screen so i have to manually re-order the terms if i ever want to update post.
idk Anh, but i think i'm gonna give on this for now and back to my old method, re-order the terms manually when post is updated. Thanks!
April 24, 2018 at 9:19 AM in reply to: Prevent terms order being overwritten when updating post #9339foundbutlost
ParticipantHi Anh,
I can see my terms in order on the select advanced field, but when i wanted to change the order, it does nothing. the order is still the same. when i add a new term, it get pushed to the very first order of the terms even though i put in the middle. I'm using wordpress default post_tag taxonomy and the default Tags field still showing on my editor screen. Do i miss something?
foundbutlost
ParticipantHow do i achieve that if i'm using a custom table to store the meta?
April 23, 2018 at 6:12 PM in reply to: Prevent terms order being overwritten when updating post #9322foundbutlost
ParticipantAh i'll take a look at it and give you an update about it later, thank you!
April 23, 2018 at 12:22 PM in reply to: Prevent terms order being overwritten when updating post #9313foundbutlost
Participanti activate this hook so i can modify wordpress post_tag sort parameter to true:
function postTag_sort_tags() { global $wp_taxonomies; $wp_taxonomies['post_tag']->sort = true; } add_action( 'init', 'postTag_sort_tags' );do you have any idea how to set it back to false after checking some condition? i've tried it but it seems init hooks is too early to get the post ID which in this case i need it for the condition.
April 20, 2018 at 5:12 PM in reply to: Prevent terms order being overwritten when updating post #9298foundbutlost
Participanti simply set this option https://imgur.com/vhZR41A
and it will set this parameter on taxonomy setting:
sort' => true,and yes, the term order is saved on
term_order columninsideterm_relationships table. to set the term order, you just need to insert it on taxonomy field like you normally do, but the difference is input sequence is matter. so you just need to insert the terms in sequence and the order set in sequence.it's an abandoned feature on wordpress and people didnt pay attention much to it, you can set the order but to show it you still need to use your custom query.
that's what im doing right now but having a trouble like i mention above. i think it's a waste to try another solution, because wordress already provide the column for us and we just need to step up using our own feet to use it.
April 18, 2018 at 9:09 AM in reply to: cloneable oEmbed fields doesn't save empty data as "NULL" #9254foundbutlost
ParticipantAny update on this, Anh?
Thank you!
foundbutlost
ParticipantWell, in my case that won't happen. Because it's a song -> album relationship so one song can only belong to one album.
-
AuthorPosts