Support

Account

Forum Replies Created

  • Puuhhh,

    You put me on the spot there, it was years ago. But what I remember is that I just added a text input field that can get a value from that database. Then I just made the input field “flat” with css to make it look just like text. Eg take away all the borders colors and what not, it was still an input field that was change on a each save in the data base automatically so if anyone changed it, it wouldn’t have matter. Never think anyone even have tried as you can’t see it is an input field.

    Hope’s it give you some ideas@

  • Hi John,

    Thanks, I guess it is just me being inpatient and it is a part of developing teaching clinets to use the system. Need to look at it from another angle, Ill put the draft button back and see if they figure that one out.

    R
    Jonas

  • I guess not, sorted with some short code magic.

  • Hi, John,

    I solved it with a text field and some css magic, thanks!

  • Hi Phil,

    Thank’s for the push in the right direction but the acf-load, did not work as I did it on a new post, it gave me the field before it was loaded (as the name suggest I suppose :-)) and messed up the load of all users.

    Maybe it has a solution but I achieved what I needed with the below one (don’t know if it is “programatically correct” but it works for me) if anyone else have the same problem:

    function my_prepare_field( $field ) {
    $screen = get_current_screen();
    $user = wp_get_current_user();
    $user = $user -> ID;

    //check if post type is new and of a specific post type
    if ( ‘add’ === $screen->action && “my_post_type” === $screen->post_type ){
    $field [‘value’]= $user; //set user to current user
    return $field;
    }
    else {
    return $field;
    }

    }

    add_filter(‘acf/prepare_field/name=my_post_type’, ‘my_prepare_field’);

  • A user field and I would like to pre populate that one with the “author” (current user)

  • Hi Phil,

    Been in to those one and poked around but that’s what makes my head spin, not too confident in PHP yet, still learning. which filter would be suitable for pre populating user value and how can I get get it to show the nickname?

    Thank’s

  • Answer it myself as I found that the dropdownbox’s was the ultimate members plugin.

  • Hi John,

    I am terrible sorry for taking such a time to come back and thank you for your answer, has been a busy time. I will look in to it one day as it is still something I want done one day.

    Thanks again for your time,

    Kru-x

  • Hi Bee,

    Thanks for your help but you misunderstand (or do I?), I need to fill the eta field out as soon as the ETD and speed is filled out (on field change) before I save the post. Like when you tab to another field it auto fills the other one, as in many computer software, excel is one exemple. hope it make sense!

  • Nop,

    I am not getting it, I can’t get acf/pre_save_post to trigger in the backend at all and read in another post that it wont work on the backend, so confused.

    If anyone has an idea how I can calculate a value from two field before I “save Post, ex. I add speed in one field and time in another then it should calculate ETA and autofill a second time field, ps I also have a distance field to do the caclulation.

    Any ideas or pointers in the right direction would be appreciated,
    Thanks

  • Hi Bee,

    Thanks for this, still trying to get my head around programming. I should probably have said that I am working in the backend of WP, would this filter work in the backend? And when is this filter triggered?

Viewing 12 posts - 1 through 12 (of 12 total)