Support Forum » User Profile

Forum Replies Created

Viewing 11 posts - 16 through 26 (of 26 total)
  • Author
    Posts
  • in reply to: using metabox fields for front end submission #10200
    davidrknowlesdavidrknowles
    Participant

    Yes, unfortunately, the post title is a bit more of a pain due to where and how the data is saved.

    What you could do is write a function in the meantime that mirrors the CF and rewrites the post title with it. You could use the submission hook rwmb_frontend_after_process, so you have the post ID to target the rewrite of the title with as I am not sure the $config submission contains the title.

    in reply to: using metabox fields for front end submission #10168
    davidrknowlesdavidrknowles
    Participant

    Yes, it is, just include it in your shortcode example: [mb_frontend_form id="your_mb_id" post_fields="title, content, excerpt, date, thumbnail."]

    You can read more about it here: https://docs.metabox.io/extensions/mb-frontend-submission/#shortcode-attributes

    Hope this helps.

    in reply to: How to include current post title on a form #10167
    davidrknowlesdavidrknowles
    Participant

    I tried this and I thought get_the_title(get_the_ID()) might work as an std but it doesn't, mainly I think due to when the filter fires.

    But I think what might work is using one of the hooks, try this:

    add_action( 'rwmb_frontend_after_process', function( $config, $post_id ) {
        if ( 'my-meta-box' === $config['id'] ) {
            $sub_title = get_the_title(get_the_ID());
            update_post_meta($post_id, 'submitted_from',  $sub_title);
        }
    }, 10, 2 );

    Change "my-meta-box" to your overall meta_box id,
    change "submitted_from" to the field you want to populate.

    If you don't want this field to show on the front end you may have to manually hide it.

    Hope this helps you.

    in reply to: edit profile #10166
    davidrknowlesdavidrknowles
    Participant

    That works perfectly. also just realised you can also pull the other standard user meta in by using their keys (first_name or last_name).

    Is it possible to use a MB helper function to retrieve data fields from the user table, like if one wanted to change s password or email in the user profile?

    in reply to: Countdown using date and time field? #10142
    davidrknowlesdavidrknowles
    Participant

    The hard part of this is getting the users time, and this could depend on timezone, DST etc.

    The only way I have found this possible is using JS to get browser information and then compare it with the server output. You will have to pass the server output to the DOM or use AJAX to make the communication with the server.

    Bit of a challenge, I was doing this for a listing site for displaying opening hours and notifying the users if the business was open, I have put it on the back burner for now.

    in reply to: edit profile #10141
    davidrknowlesdavidrknowles
    Participant

    How are you guys travelling with this?

    I am at this same junction if its possible to have a password to confirm the submission of changed user details. It would also be handy to append the form first rather than after the authenticated field.

    in reply to: Columns randomly nesting within them selves #10070
    davidrknowlesdavidrknowles
    Participant

    This is the rendered HTML on the page, as you can see the last column is nesting two of the fields, I don't really understand why:

    https://pastebin.com/qxLDcJa1

    in reply to: Columns randomly nesting within them selves #10069
    davidrknowlesdavidrknowles
    Participant

    This is a simplified version out of the builder that seems to have the same strange rendering behaviour:

    https://pastebin.com/atXRKHm4

    in reply to: Getting Field Value #10036
    davidrknowlesdavidrknowles
    Participant

    just to get your thoughts and for others reading this, would just using something like array_walk_recursive be the best course of action to collect all the keys and values into a single object, like:

    $group_values = rwmb_meta( 'group_in_question', array( 'object_type' => 'setting' ), 'settings_option_name' );
    $found = [];
    array_walk_recursive($group_values, function($value, $key) use (&$found)  {
            $found[$key] = $value;
    });
    return $found;
    in reply to: Getting Field Value #10034
    davidrknowlesdavidrknowles
    Participant

    Thanks, Anh, keep up the great work.

    in reply to: Getting Field Value #9996
    davidrknowlesdavidrknowles
    Participant

    Ok an update, I did some digging and due to some of the loops I was running I used a few nested groups to manage data like group=>group so I cleaned that up with an array merge, but it still doesn't work there are still nested groups but all have a purpose.

    So then I thought I would try getting the rwmb_meta for the first parent group.... BANG it returned all the values that had been changed from their default value in an array with the array in that with the key and values.

    Is this normal behaviour for rwmb_meta in a group scenario? you have to target the Group ID and them loop through all the results?

    Thanks

Viewing 11 posts - 16 through 26 (of 26 total)