How can I save a setting field with multiple checkbox options generated by a foreach loop on a custom wordpress admin page?

You can use the function xprofile_get_field_data( $field, $user_id, $multi_format) * @param mixed $field The ID of the field, or the $name of the field. * @param int $user_id The ID of the user. * @param string $multi_format How should array data be returned? ‘comma’ if you want a * comma-separated string; ‘array’ if you want … Read more

modify buddpress adminbar only in admin pages

You ca use the conditional tag is_admin() to check if you are on the front-end or back-end like this: function bp_adminbar_currentsite_menu() { global $bp; if (!is_admin()){ ?> <li> <!– Insert your link url or relative url, and your link text below –> <a href=”http://EXAMPLE.COM”>EXAMPLE LINK TEXT</a> </li> <?php } } // Call The Function Above … Read more

Delete user account – If user has attachments uploaded then redirect (with a message) [closed]

I got it: function custom_get_count_before_delete() { global $bp, $wpdb; $user_id = $bp->loggedin_user->id; return $wpdb->get_var( $wpdb->prepare( ” SELECT COUNT(DISTINCT p.ID) FROM $wpdb->posts p WHERE p.post_author = %d AND p.post_status=”inherit” AND p.post_type=”attachment””, $user_id ) ); } function custom_check_delete_account() { global $bp; if ( $bp->current_component == ‘settings’ && $bp->current_action == ‘delete-account’ ) { if ( $count = custom_get_count_before_delete() … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)