BuddyDev

Search

Replies

  • Participant
    Level: Master
    Posts: 281
    NikB on in reply to: [Resolved] Posting in groups #46327

    Thank you Brajesh, that’s exactly what I’m hoping for…

    Sorry to be so persistent but just wondering if there’s any update on how things are progressing and when it’s likely to be available 😉

    Regards
    Nik

  • Participant
    Level: Master
    Posts: 281
    NikB on in reply to: [Resolved] BuddyBlog Pro – Custom field types #46302

    Hi Brajesh

    Hopefully obviously, the code I posted was not complete and really only designed to test a theory, but I do take your point that creating a field type and then setting the postmeta directly with that may be a cleaner way to go.

    That said, I’d still love to understand why $_POST[‘my_custom_field’] (ie. where my_custom_field is any custom field that has been created in BuddyBlog) doesn’t seem to return a value regardless of the field type it has been assigned. If it’s easy to explain, I’d be very grateful… if not, no worries… I’ll focus on doing things the way you suggest for now.

    Regards
    Nik

  • Participant
    Level: Master
    Posts: 281
    NikB on in reply to: [Resolved] BuddyBlog Pro – Custom field types #46293

    Hi Brajesh

    I’ve made a start on attempting to update my Event custom post type postmeta by creating a custom field (my_date) on the relevant form and then using the code below but for some reason, it doesn’t seem to be picking up a value for $_POST[‘my_date’].

    This doesn’t seem to be anything to do with the field type as I’ve tried changing it to a text field and that doesn’t seem to make any difference. Indeed, if I run the same code but using $_POST[‘bbl_post_title’] then everything works fine (even if it doesn’t make much sense!) so this seems to be an issue with custom fields only…

    Could it be something to do with the fact taht the field name actually seems to appear as “bbl_custom_field[my_date]” (ie. including square brackets in the name itself) so possibly I need to reference it slightly differently?

    Here’s the code I’ve tried so far…

    ` add_filter( ‘bblpro_post_submission_prepared_data’, function ( $post_data, $form_id, $post, $is_submission ) {

    if ( 2487 === (int) $form_id ) {

    $mydate = $_POST[‘my_date’] . ‘ 11:00:00’;
    //$mydate = $_POST[‘bbl_custom_field[my_date]’] . ‘ 11:00:00’;

    if ( ! empty( $post_data[‘ID’] ) ) {
    update_post_meta( $post_data[‘ID’], ‘_EventStartDate’, $mydate);

    }
    }

    return $post_data;
    }, 10, 4 ); `

    With many thanks in advance for any thoughts.
    Nik

  • Participant
    Level: Master
    Posts: 281
    NikB on in reply to: [Resolved] BuddyBlog Pro – Custom field types #46287

    Thank you so much Brajesh. That’s exactly the kind of info I needed… I’ll take a look.

    Regards
    Nik

  • Participant
    Level: Master
    Posts: 281
    NikB on in reply to: [Resolved] BuddyBlog Pro – Custom field types #46267

    Hi Brajesh

    Just wanted to add that having just discovered the ‘bblpro_post_submission_prepared_data’ filter, it looks as if it would be relatively easy for me to combine a time field (such as that which you suggested above) with the existing date field in order to save the postmeta in a suitable format for my events plugin.

    In other words, if implementing the above time field would be a relatively “quick fix” as compared to implementing a full date/time field, that would certainly be perfectly acceptable for my purposes at this stage… and if it’s something I can implement myself (with a little guidance from you) even better…

    No worries if not though… the groups functionality is far more of a priority for me at least and hope that’s all going well.

    Regards
    Nik

  • Participant
    Level: Master
    Posts: 281
    NikB on in reply to: [Resolved] Posting in groups #46242

    Many thanks Brajesh. Although I do understand these things take time, I must admit, timing is starting to be quite critical for me now so fingers crossed all goes well and it won’t be too much longer.

    Incidentally don’t want to take up any more of your time than necessary, but can you just confirm that once complete, users will be able to create their posts from within groups (rather than posting from their profiles and having to select the group in which they want it posted)?

    Regards
    Nik

  • Participant
    Level: Master
    Posts: 281
    NikB on in reply to: [Resolved] Posting in groups #46229

    Hey Brajesh

    Sorry to ask again but just wondering how things are progressing with this?

    Regards
    Nik

  • Participant
    Level: Master
    Posts: 281
    NikB on in reply to: [Resolved] BuddyBlog Pro – Custom field types #46208

    Hi Brajesh

    Many thanks for considering this. Although not ideal, I guess I MAY be able to get around it temporarily by using text fields and instructing the users to use a particular format when entering their date/time (and just hope the users actually read and follow the instructions) but if/when you have time, a date/time field would definitely be useful and very much appreciated.

    Regards
    Nik

  • Participant
    Level: Master
    Posts: 281
    NikB on in reply to: [Resolved] BuddyBlog Pro Posts Layout #46188

    Thank you Brajesh. I’ve got it now and that all makes sense.

    Thank you also for explaining re. post specific overrides as that would probably have been my next question.

    Regards
    Nik

  • Participant
    Level: Master
    Posts: 281
    NikB on in reply to: [Resolved] BuddyBlog Pro – Custom field types #46185

    Hi Brajesh

    Thank you and that certainly looks promising.

    Although actually I’ve just checked the postmeta for the events plugin I’m currently testing and unfortunately it seems to store the start date/time in the same field in the format “2022-08-31 08:00:00” that said… perhaps there is some way I could combine a BuddyBlog Pro date field along with a time field prior to saving, in order to produce the relevant string for the meta?

    Regards
    Nik