Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)

  • mrjcgoodwin
    Participant

    @mrjcgoodwin

    There’s one last thing you might be able to provide me with a bit of a pointer on….

    I’m trying to make my new field compulsory, but cannot get my head round where/how BP is handling the validation for the default field. Any idea how I can implement this? – ideally in a non-destructive way.


    mrjcgoodwin
    Participant

    @mrjcgoodwin

    Thanks for the reply – I already fixed it in the end as per post above – I was using bp_activity_id() by mistake instead of bp_get_activity_id() which fixed it :-).

    Thanks for all your pointers – first time using BP so the help has gone a long way!


    mrjcgoodwin
    Participant

    @mrjcgoodwin

    Oops – obvious mistake – got to use bp_get_activity_id(); instead.


    mrjcgoodwin
    Participant

    @mrjcgoodwin

    Thanks for your help the other day, I’ve almost got this all sorted now, but coming unstuck on the last bit of displaying my new meta info on the front end, hoping you can spot my error in the below!

    I’m modding the entry.php template to display my new meta data:

    If I use

    
    $actID = bp_activity_id();
    echo bp_activity_get_meta( $actID,'Activity Title' );
    

    it wrongly returns the ID of the activity instead of the meta data for the key ‘Activity Title’.

    If I hard code the ID number in it works, e.g.:

    
    //$actID = bp_activity_id();
    echo bp_activity_get_meta( 40,'Activity Title' );
    

    I also know that bp_activity_id() is getting the correct ID numbers as if I simply echo out its value it correctly appends a different ID to each activity output by the template, but I cannot combine the two.

    I’ve also tried ensuring the ID number is an integer before using it in the get_meta function. Any ideas? I’m puzzled!!

    (Note I’ve changed my goal slightly, I’m now just displaying a custom title field for an activity in case you were wondering.)


    mrjcgoodwin
    Participant

    @mrjcgoodwin

    Thanks Henry will check this out. It’s not necessarily important that the meta info is using the same structure as the regular WP ones, just that we can segregate the the activity types if possible.

    Would you suggest we would be able to mod the activity form then to achieve this, or are we better off doing this another way. I’m new to BP, but surprised this isn’t a baked in function.

Viewing 5 replies - 1 through 5 (of 5 total)
Skip to toolbar