Skip to:
Content
Pages
Categories
Search
Top
Bottom

Unable to update ass_digest_items in wp_usermeta table

  • @neerajkumar2020

    Participant

    Please help me how can i update the meta_value for ass_digest_items that is present in the usermeta table when any post/comment is added.

    Thanks & Regards
    Neeraj Kumar

Viewing 5 replies - 1 through 5 (of 5 total)
  • @neerajkumar2020

    Participant

    Please help me what is the use of “ass_digest_items” in usermeta table (buddypress) and how can i update the value when any comment/post is added.

    @mercime

    Participant

    @neerajkumar2020 have you posted at plugin’s support forum as Henry suggested in https://buddypress.org/support/topic/buddypress-ass_digest_items-in-usermeta-table/ ?

    @neerajkumar2020

    Participant

    I have already posted as respect to Henery suggested, but still i am waiting for any response

    @henrywright

    Moderator

    Hi @neerajkumar2020

    The plugin authors are possibly busy, I’m sure they’ll get back to you if they can.

    In the mean time you could try using a filter to do what you need.

    https://codex.wordpress.org/Function_Reference/add_filter

    Regarding when posts are published, I think publish_post is the one you need to use.

    https://codex.wordpress.org/Plugin_API/Action_Reference/publish_post

    So as an example, you’d add something like this to your theme’s functions.php file

    function my_custom_filter_function( $post_id ) {
        // the post has been published so let us update the value of ass_digest_items
        // your value can be a string, an array, an integer etc...
        bp_update_user_meta( get_current_user_id(), 'ass_digest_items', 'Your value goes here' );
    }
    add_action( 'publish_post', 'my_custom_filter_function' );

    @neerajkumar2020

    Participant

    Hi Henry,

    I have checked with plugin:
    buddypress-group-email-subscription/bp-activity-subscription-digest.php
    there is conditional checked with database
    i.e
    $user_subscriptions = $wpdb->get_results( $wpdb->prepare( “SELECT user_id, meta_value FROM $wpdb->usermeta WHERE meta_key = ‘ass_digest_items’ AND meta_value != ”” ) );

    Please help me by explaining , in which condition meta_value is updated for meta_key = ‘ass_digest_items’

    Thank you in advance.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Unable to update ass_digest_items in wp_usermeta table’ is closed to new replies.
Skip to toolbar