Skip to:
Content
Pages
Categories
Search
Top
Bottom

create xprofile fields from plugin


  • sandorastarita
    Participant

    @sandorastarita

    Hello, I’m trying to create xprofile fields from my plugin code, and not from admin interface. Is this possible? Can somebody help me?

    working with WP 4.7.2 and buddypress 2.8, with Onesocial Marketplace theme.

    Thanks in advance.

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

  • Henry Wright
    Moderator

    @henrywright

    I believe xprofile_insert_field() will insert or update a profile field. Here’s an example of how to use it:

    $f = xprofile_insert_field( array(
        'field_group_id' => 8,
        'type'           => 'textbox',
        'name'           => 'Foo',
        'is_required'    => false,
        'can_delete'     => false,
        'description'    => 'This is a description.'
    ) );

    On success, $f will be the ID of the new field.


    sandorastarita
    Participant

    @sandorastarita

    Thank you very much!!!


    darunia77
    Participant

    @darunia77

    Hello, @henrywright, is this code to be used instead of an xprofile plugin?

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Skip to toolbar