Skip to content

Instantly share code, notes, and snippets.

@KaineLabs
KaineLabs / yzc_add_registation_interest_field.php
Created June 22, 2021 01:12
BuddyPress - Add Registration and Profile Settings Custom Field
<?php
/**
* Add Custom Registration Fields.
*/
function yzc_add_registation_interest_field() {
global $wpdb;
$listinterest = $wpdb->get_results("select a.`term_id`, a.`name` from `".$wpdb->prefix."terms` as a
inner join `".$wpdb->prefix."term_taxonomy` as b on b.term_id = a.`term_id` and b.taxonomy = 'category' order by a.`name` asc
@KaineLabs
KaineLabs / yzc_after_verifying_account_send_email.php
Last active March 1, 2022 17:25
Send Email to User When His Account Gets Verified
<?php
/**
* Send Email to User When His Account Gets Verified.
*/
add_action('yz_after_verifying_account', 'yzc_after_verifying_account_send_email', 999, 1);
function yzc_after_verifying_account_send_email($user_id){
$user_info = get_userdata($user_id);
$to = $user_info->user_email;
$subject = 'Your Account is Verified.';
$body = 'Dear user, your account is verified successfully!';
@danielbachhuber
danielbachhuber / gist:7126249
Last active December 21, 2021 15:46
Include posts from authors in the search results where either their display name or user login matches the query string
<?php
/**
* Include posts from authors in the search results where
* either their display name or user login matches the query string
*
* @author danielbachhuber
*/
add_filter( 'posts_search', 'db_filter_authors_search' );
function db_filter_authors_search( $posts_search ) {