Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to change Extended Profile Status to SPAM programatically?


  • jessy
    Participant

    @jessy-marco

    I want to use something like this, but id doesn’t work:

    xprofile_set_field_data('user_status', "39", "spam");

    I need code to do this: change user status in extended profile to Spammer for user with id 39, programatically, because I can do it just in the admin manually, which works for me just fine.

    Thank You

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

  • shanebp
    Moderator

    @shanebp

    user_id is an integer, not a string.
    Try:
    xprofile_set_field_data('user_status', 39, 'spam');


    jessy
    Participant

    @jessy-marco

    I copy it into bp-custom.php:
    Fatal error: Call to undefined function xprofile_set_field_data() in bp-custom.php

    In my functions.php I used action, still do not work:

    
    function oi_bp_actions_and_filters() {
      xprofile_set_field_data('user_status', 39, 'spam');
    add_action('bp_init', 'oi_bp_actions_and_filters');
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to change Extended Profile Status to SPAM programatically?’ is closed to new replies.
Skip to toolbar