Search
 
SCRIPT & CODE EXAMPLE
 

PHP

how to follow unfollow on buddypress ajax call

<?php
if ( function_exists( 'bp_follow_add_follow_button' ) ) :
	if ( bp_loggedin_user_id() && bp_loggedin_user_id() != get_the_author_meta( 'ID' ) ) {
		bp_follow_add_follow_button( array(
			'leader_id'   => get_the_author_meta( 'ID' ),
			'follower_id' => bp_loggedin_user_id(),
			'link_class'  => 'post-follow-btn'
		) );
	}
endif;
?>
//jQuery Also here
  <script>
  jQuery( document).ready( function ($) {
    $(document).on("click", ".hentry .follow-button a", function() {
        bp_follow_button_action( $(this) );
        return false;
    });
});
  </script>
Comment

PREVIOUS NEXT
Code Example
Php :: not have permision elgg settings.php 
Php :: in packagemanifest.php line 131 undefined index name 
Php :: odoctrine querybuilder print sql 
Php :: CURLAUTH_BEARER cannot find 
Php :: contact form dropdown from post 
Php :: is_wplogin 
Php :: Google Dorks Using special search string for Web Server Detection 
Php :: symfony create form multiple entities 
Php :: php hook function 
Php :: laravel-5-on-shared-hosting-wrong-public-path 
Php :: laravel eloquent where date today 
Php :: magento2 join table with prefix 
Php :: public function __sleep() and __wakeup() 
Php :: 0.02 eth to php 
Php :: php int to indonesian rupiah 
Php :: create new laravel project 
Php :: login php 
Php :: just page name in url 
Php :: laravel facade 
Php :: artisan command to add resources to controller 
Php :: Turn error log WP 
Php :: order item add hook WooCommerce admin panel 
Php :: php slow 
Java :: basic hello world program in java 
Java :: java get current year 
Java :: circular imageview android 
Java :: cordova android.useandroidx 
Java :: java setinterval equivalent 
Java :: ranfom number between 1 to 100 java 
Java :: android hide keyboard 
ADD CONTENT
Topic
Content
Source link
Name
3+6 =