Support Forum » User Profile

Forum Replies Created

Viewing 15 posts - 1 through 15 (of 18 total)
  • Author
    Posts
  • foundbutlostfoundbutlost
    Participant

    I think it's all good and working fine now. Thank you for the update and thread closed!

    foundbutlostfoundbutlost
    Participant

    Hi, i didnt see any update on my account dashboard. you talking about MB Custom Table Extension right?

    foundbutlostfoundbutlost
    Participant

    Yes 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!

    foundbutlostfoundbutlost
    Participant

    I 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 🙁

    foundbutlostfoundbutlost
    Participant

    Ah 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

    in reply to: rwmb_get_value( ) accepted argument request #9349
    foundbutlostfoundbutlost
    Participant

    Yep, actually i'm currently using that right now. Thank you and closed!

    in reply to: Prevent terms order being overwritten when updating post #9345
    foundbutlostfoundbutlost
    Participant

    Yes, 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.

    in reply to: Prevent terms order being overwritten when updating post #9342
    foundbutlostfoundbutlost
    Participant

    Currently 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!

    in reply to: Prevent terms order being overwritten when updating post #9339
    foundbutlostfoundbutlost
    Participant

    Hi 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?

    in reply to: rwmb_get_value( ) accepted argument request #9323
    foundbutlostfoundbutlost
    Participant

    How do i achieve that if i'm using a custom table to store the meta?

    in reply to: Prevent terms order being overwritten when updating post #9322
    foundbutlostfoundbutlost
    Participant

    Ah i'll take a look at it and give you an update about it later, thank you!

    in reply to: Prevent terms order being overwritten when updating post #9313
    foundbutlostfoundbutlost
    Participant

    i 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.

    in reply to: Prevent terms order being overwritten when updating post #9298
    foundbutlostfoundbutlost
    Participant

    i 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 column inside term_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.

    in reply to: cloneable oEmbed fields doesn't save empty data as "NULL" #9254
    foundbutlostfoundbutlost
    Participant

    Any update on this, Anh?

    Thank you!

    in reply to: How to retrieve connected post on each related post #9253
    foundbutlostfoundbutlost
    Participant

    Well, in my case that won't happen. Because it's a song -> album relationship so one song can only belong to one album.

Viewing 15 posts - 1 through 15 (of 18 total)