Forum Replies Created
-
AuthorPosts
-
Eliodata
ParticipantHi,
I finally use this snippet to display a metabox in my cpt with a link to the related user. The link display the billing company field, but you can use any other user field.
// MODIFIER AFFICHAGE CHAMP relationnel clients-wp-bdd METABOX.IO cote BDD clients add_action( 'add_meta_boxes', 'add_link_to_wp_user_meta_box' ); function add_link_to_wp_user_meta_box() { add_meta_box( 'link_to_wp_user_meta_box', // ID unique 'Lien vers le compte utilisateur WP', // Titre de la metabox 'display_link_to_wp_user_meta_box', // Fonction callback pour afficher le contenu 'client', // Le CPT auquel cette metabox est liée 'side', // Position de la metabox 'high' // Priorité de l'affichage ); } function display_link_to_wp_user_meta_box( $post ) { global $wpdb; // Récupérer l'ID de l'utilisateur associé au CPT via la relation 'clients-wp-bdd' $client_id = $post->ID; $user_id = $wpdb->get_var( $wpdb->prepare( "SELECT <code>from</code> FROM {$wpdb->prefix}mb_relationships WHERE <code>to</code> = %d AND <code>type</code> = 'clients-wp-bdd'", $client_id )); if ( !empty( $user_id ) ) { // Récupérer les informations de l'utilisateur WP $user = get_userdata( $user_id ); $billing_company = get_user_meta( $user_id, 'billing_company', true ); $edit_link = get_edit_user_link( $user_id ); // Afficher un lien cliquable vers la page d'édition de l'utilisateur WP if ( !empty( $billing_company ) ) { echo '<p>Société : <a href="' . esc_url( $edit_link ) . '">' . esc_html( $billing_company ) . '</a></p>'; } else { echo '<p>Aucun champ "billing_company" trouvé pour cet utilisateur.</p>'; } } else { echo '<p>Aucun utilisateur lié trouvé.</p>'; } }Eliodata
ParticipantEliodata
ParticipantThank you for the quick answer. Hope they will find something.
If you give some clues maybe I could on my side.
Best regardsEliodata
ParticipantThank you!
Eliodata
ParticipantHello,
Ok I understand what you mean. The default value is displayed when I clone the field.
In my case this is a group of datetime fields. I don't clone the datetime field but all the group.
I checked the "clone default value" at the group level and now it works. Many thanks!Is it possible to limit the available time slots (disable useless hours)?
Eliodata
ParticipantHi,
Thank you
https://formationstrategique.fr/wp-content/uploads/datetimepick1.png
https://formationstrategique.fr/wp-content/uploads/datetimepick2.png
https://formationstrategique.fr/wp-content/uploads/datetimepickbox.pngI have tried 2023-10-13 and 10-13-2023
September 30, 2023 at 11:34 PM in reply to: ✅Builder custom fields disapear after adding new dropdown field option #43399Eliodata
ParticipantHello. It works, thank you! I had to enable this option for all the 60 fields but now I can see and edit them all.
Best regardsSeptember 30, 2023 at 6:50 PM in reply to: ✅Builder custom fields disapear after adding new dropdown field option #43395Eliodata
ParticipantHi, thank you for the quick answer!
July 15, 2023 at 3:57 PM in reply to: ✅Issue with disappearing data in metabox.io custom fields #42586Eliodata
ParticipantHello,
It works. Any idea why it wasn't a problem the 2 last years?Thank you!
July 14, 2023 at 9:22 PM in reply to: ✅Issue with disappearing data in metabox.io custom fields #42570Eliodata
ParticipantThank you for the quick answer.
Same problem when I activate the "save field value" option. Any change in the custom fields or the settings erase the content...
You can see the issue in video here:November 6, 2022 at 2:29 AM in reply to: Problem unresolved, wooc orders custom field and relationnal #38964Eliodata
ParticipantHi,
sorry to bother you with this, but do you think there is a chance to solve this problem? I really need this feature...
Best regardsEliodata
ParticipantHi,
Thank you for the support. Could you find the solution?
RegardsEliodata
ParticipantI have the same issue using relationships addon. I tried bidirectionnal relationship between CPT and shop_order but still can't see order in the metabox select field.
I installed posts 2 posts plugin (by scribu) with the same settings and it works. But I don't want to use another plugin. And I the relationship to work with admin column plugin, as metabox.io does.
Do you have an idea to make this work please?
Eliodata
ParticipantHello,
Thank you for the quick answer!I tried two snippets:
add_action('init', 'wc_orders_public'); function wc_orders_public() { global $wp_post_types; $wp_post_types['shop_order']->public = true; }and:
add_action('init', 'wc_orders_public'); function wc_orders_public() { global $wp_post_types; $wp_post_types['shop_order']->public = true; $wp_post_types['shop_order']->publicly_queryable = true; $wp_post_types['shop_order']->exclude_from_search = false; $wp_post_types['shop_order']->rewrite = true; $wp_post_types['shop_order']->query_var = 'shop_order'; }But still doesn't work.
Regards
Eliodata
ParticipantIt's ok, thank you again!
Last question... each time I send a file wordpress creates a new post with attached file. Is it possible to skip this?
And the the uploaded file is renamed with the extension. myfile.png becomes username_myflie.png.png -
AuthorPosts