Forum Replies Created
-
AuthorPosts
-
[email protected]
ParticipantHello, I think, related with this post:
I save in the custom table of users named "usuarios", a avatar image of this user:$meta_boxes[] = array( //'title' => 'Custom avatar', 'id' => 'avatar', 'type' => 'user', // Specifically for user 'storage_type' => 'custom_table', // Important 'table' => 'usuarios', // Your custom table name 'fields' => array( array( 'name' => 'Subir/Upload Avatar', 'id' => 'avatar', 'type' => 'image_advanced', 'max_file_uploads' => 1, ), ), );The value of the image saved is: a:2:{i:0;s:0:"";i:1;i:734;}
It's ok? Or I have to make the econding? How can I make this encoding?
To get the image in a post, I have to make this function:
1.- First I get the row of the user in $r
2.- Take the value of the image: $resultado = $r['avatar'];
3.- $resultado = 'img src="'.$r['avatar'].'" /> '; // don't put here the initial < because don't show the code the post...But this don't run, don't know how to save and get the image to show in frontend...
In the documentation: https://docs.metabox.io/fields/image-advanced/
$images = rwmb_meta( 'info', array( 'limit' => 1 ) ); --> I modify the field 'info' for my image field: $r['avatar'] $image = reset( $images ); $izquierda .= '<img src="'.$image['url'].'" />';But don't run...
Can you help me please?
Thanks,
Sergio[email protected]
Participantoh perfect!! Thanks!!
[email protected]
Participantoh yes, it's no activated geolocation extension... Sorry!!
Thanks.
[email protected]
ParticipantOh, it works well for me, forget my previous message. Thank you!!
[email protected]
ParticipantHello, many thanks!!
Questions... I don't want to use a new page to insert the map... I want to put the map in the top of each archive pages of each cpt.
To do that:
1.- I have to put his line in my archive page?2.- I have to update something in the wp_enqueue_script function in functions.php ?
3.- I have to modify something in the list.js ?
4.- I have to put the list.js in my js folder?
In my theme is here: .../wp-content/themes/theme-name/assets/js/
In functions.php I have to update this code?
wp_enqueue_script( 'list', get_parent_theme_file_uri( 'js/list.js' ), ['jquery', 'leaflet'], '1.0', true );
to
wp_enqueue_script( 'list', get_parent_theme_file_uri( 'js/assets/list.js' ), ['jquery', 'leaflet'], '1.0', true );Many thanks for your help.
Sergio[email protected]
ParticipantHello, you finally wrote the tutorial?
Thanks,
Sergio[email protected]
ParticipantThanks for your update in the 4.18 version, to can create new taxonomies with the parameters 'add_new' => true.
Can you hide this parameter? That only can create taxonomies for certain users or certain conditions?
Thanks,
SergioMay 3, 2019 at 3:48 PM in reply to: ✅Problem with autocomplete field in OSM when I use with googlemap in the sameform #14409[email protected]
ParticipantAh ok, I wanted to put both, with a radio field, to hide one of the two maps, and that the user could choose to create a business with Google Maps or open a street map ... But I see that I will have to think of another solution ...
Thanks.
[email protected]
ParticipantPerfect, I will be pending for future news. Thank you!!
May 2, 2019 at 8:06 PM in reply to: Hidden a group of metabox fields wiht a radio value of another metabox group #14391[email protected]
ParticipantHello,
This second method, Set the rule for the whole meta box B, don't do nothing for me, not run in front office... In the back office it run well.
To run well in the front office I have to do the option 1, Set the rule for each field in the meta box.
Don't know if the problem is only for me...
Thanks
May 2, 2019 at 4:52 PM in reply to: ✅Filterin select advanced with custom field in custom table #14387[email protected]
ParticipantPerfect!! Many thanks!!
April 30, 2019 at 4:06 PM in reply to: ✅Show field in frontend but not allow to edit by the user #14355[email protected]
ParticipantHello,
I try this:
'readonly' => true,
and it run ok!! Users can't edit the field and the value is saved in the custom table.Sergio
April 30, 2019 at 5:29 AM in reply to: ✅Show field in frontend but not allow to edit by the user #14352[email protected]
ParticipantHello,
I have a proble using:
'disabled' => !is_admin(), // This disables editing in the front end.With a meta box with:
'storage_type' => 'custom_table', // ImportantIs that all fields are saved well in the custom table except the fields that I put 'disabled' => !is_admin()...
Have you detected if it is a general error? Or does it just happen to me?
I try to put this like this
'attributes' => array(
'disabled' => true,
),
But it doesn't matter, not save the value...Thanks.
April 27, 2019 at 10:14 PM in reply to: ✅Filterin select advanced with custom field in custom table #14336[email protected]
ParticipantOh, thanks, I understand.
So I do not know if it can be done or if in this forum you could guide me for the following:
To obtain in the results of the select_advanced the users of a custom table related to the users according to a condition that occurs on a field saved in the custom table itself.Thanks
April 27, 2019 at 10:01 PM in reply to: ✅Same metabox fields in diferents CPT and diferents Custom Tables #14334[email protected]
ParticipantWhat a good solution, I loved it, much easier to manage and with many fewer lines of code.
Thank you.
-
AuthorPosts