how to get buddy press messages based on thready_id?

Dig a little deeper into the BP Messages file and you will see that bp_message_thread_content() only outputs the last message in the thread. Similarly with bp_message_thread_subject(). bp_message_thread() sets up the last message data but no other message data. Instead it looks like you want a new class of BP_Messages_Thread_Template to output the messages for the … Read more

Wrapping shortcode content in a span or link

Get out of the switch block before placing the final return statement. if you place return at the end of the switch block that way, the switch block already ends before it gets to the return statement (because of the previous matching break statements). The correct CODE will be: // just in case $summary is … Read more

Strange special character/Latin characters

Still no idea that why and how this happened all of sudden. But here is the 2 Solutions I found which is working: Applying anyone will work 1. Comment these two – //define(‘DB_CHARSET’, ‘utf8’) and //define(‘DB_COLLATE’, ”) 2. Use Latin1, (‘DB_CHARSET’, ‘latin1’) However, I am suspecting some attacks on our sever where blogs are hosted … Read more

WordPress default contact form

While Jetpack is a plugin, it’s developed by WordPress and has contact forms as standard. There are some other useful features such as stats, etc. so it’s definitely worth a look. https://jetpack.com/

Role exception for a settings sub menu

You can see here a list of roles and capabilities, if you want to check if the user has a certain role, you can: $the_user = wp_get_current_user();//we get the current user if ( in_array( ‘the_name_of_your_role’, (array) $the_user->roles ) ) { //the user has the rol, add the submenu here } you can use current_user_can if … Read more

Getting Member Data From WhishList Member on Register

Please refer to the link below and read on how to use add_action correctly. https://developer.wordpress.org/reference/functions/add_action/ add_action(‘wishlistmember_shoppingcart_register’, ‘get_member_info’)); function get_member_info() { // Debug $_POST. echo ‘<pre>’; var_dump($_POST); exit; }

str_replace not preserving whitespace

Did you clear cache after making changes with trim()? Try with: str_replace( trim( $parent->name ), $link, $intro_text ); Are you sure that the term is Upbeat Electronic music and not UpbeatElectronic music? Try with this to be sure: str_replace( trim( $parent->name ), ‘ ‘ . $link, $intro_text );