Skip to:
Content
Pages
Categories
Search
Top
Bottom

Plugin development — xprofile questions


  • Ashwani
    Participant

    @ashwanim

    Hi Friends,

    I have recently started plugin development for Buddypress. I have fair knowledge of PHP and understand basics of Plugin development. Please can you help me with certain queries below:

    1. I understand using action hooks I can call my own function, but how can say that call my function after or before the action hook. e.g. I want to display new fields / text in User profile page so I’m attaching my function in action hook ‘xprofile_template_loop_end’, but this writes all the fields and ‘Save’ button and then calls my function so my fields/text comes after ‘Save’ button. Am I using correct hook? Or there should be different way?
    2. How can I know in my function (to take appropriate action) the current selected option by user. e.g. action hook ‘xprofile_template_loop_end’ can be called in display and edit profile, how can I know in my function that it is edit or just display?
    3. How can I add new fields on a page and database thru plugin and not manually editing the page?

    Appreciate your help.

    thanks & regards,
    Ashwani

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

  • Ashwani
    Participant

    @ashwanim

    Hi,

    I have found answer to my 2nd question. We can use Custom Loop template class bp_is_profile_edit(), it returns true if the custom function is called from the edit profile page.

    Still trying to find answers to 1st and 3rd question. Please help.

    Regards,
    Ashwani


    Ashwani
    Participant

    @ashwanim

    I have found ans to first question also. I have hooked my function to ‘bp_after_profile_field_content’, so now all new fields I can display before ‘Save’.

    Still working on 3rd question.

    Regards,
    Ashwani

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Plugin development — xprofile questions’ is closed to new replies.
Skip to toolbar