PeepSo plugin provides a filter to add custom settings under preferences tab of PeepSo User Profile page. By using this filter, you can easily add your settings to PeepSo member profile page.

Here is an example which add & save settings.

add_filter(‘peepso_profile_preferences’, ‘wb_peepso_preference_custom_settings’, 15, 1 );

function wb_peepso_preference_custom_settings( $pref ) {
$meta_prefix = ‘peepso_’;
$custom_setting_fields = array();
$meta = get_user_meta( get_current_user_id(), $meta_prefix.’custom_notification_setting’ , TRUE );
$setting_val = ((” !== $meta) ? $meta : 0);
$custom_setting_fields[ $meta_prefix.’custom_notification_setting’] = array(
‘label-desc’ => __(‘Add Custom Notification When someone like your post’, ‘TEXT_DOMAIN’ ),
‘value’ => $setting_val,
‘type’ => ‘yesno_switch’,
‘loading’ => TRUE
);

$custom_settings = array(
‘wb_custom_notification_setting’ => array(
‘title’ => __(‘Custom Notification Settings’, ‘TEXT_DOMAIN’ ),
‘items’ => $custom_setting_fields
),
);
$pref = array_merge( $pref, $custom_settings );
return $pref;
}

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.