wpl_is_enabled_sitewide, ! get_option( disabled_likes

wpl_is_enabled_sitewide, ! get_option( disabled_likes

Appears in:
Hook Type: filter

See hook in core

Displaying hooks found in version: jetpack.16.0.1

apply_filters('wpl_is_enabled_sitewide, ! get_option( disabled_likes') is found 8 times:

  • /json-endpoints/class.wpcom-json-api-post-endpoint.php line 280
    					$response[ $key ] = (bool) pings_open( $post->ID );
    					break;
    				case 'likes_enabled':
    					/** This filter is documented in modules/likes.php */
    					$sitewide_likes_enabled = (bool) apply_filters( 'wpl_is_enabled_sitewide', ! get_option( 'disabled_likes' ) );
    					$post_likes_switched    = get_post_meta( $post->ID, 'switch_like_status', true );
    					$post_likes_enabled     = $post_likes_switched || ( $sitewide_likes_enabled && $post_likes_switched !== '0' );
    					$response[ $key ]       = $post_likes_enabled;
    					break;
    				case 'sharing_enabled':
    					$show = true;
    
  • /json-endpoints/class.wpcom-json-api-update-post-endpoint.php line 598
    		}
    
    		// Set like status for the post.
    		/** This filter is documented in modules/likes.php */
    		$sitewide_likes_enabled = (bool) apply_filters( 'wpl_is_enabled_sitewide', ! get_option( 'disabled_likes' ) );
    		if ( $new ) {
    			if ( $sitewide_likes_enabled ) {
    				if ( false === $likes ) {
    					update_post_meta( $post_id, 'switch_like_status', 0 );
    				} else {
    					delete_post_meta( $post_id, 'switch_like_status' );
    
  • /json-endpoints/class.wpcom-json-api-update-post-v1-1-endpoint.php line 676
    		}
    
    		// Set like status for the post.
    		/** This filter is documented in modules/likes.php */
    		$sitewide_likes_enabled = (bool) apply_filters( 'wpl_is_enabled_sitewide', ! get_option( 'disabled_likes' ) );
    		if ( $new ) {
    			if ( $sitewide_likes_enabled ) {
    				if ( false === $likes ) {
    					update_post_meta( $post_id, 'switch_like_status', 0 );
    				} else {
    					delete_post_meta( $post_id, 'switch_like_status' );
    
  • /json-endpoints/class.wpcom-json-api-update-post-v1-2-endpoint.php line 681
    		}
    
    		// Set like status for the post.
    		/** This filter is documented in modules/likes.php */
    		$sitewide_likes_enabled = (bool) apply_filters( 'wpl_is_enabled_sitewide', ! get_option( 'disabled_likes' ) );
    		if ( $new ) {
    			if ( $sitewide_likes_enabled ) {
    				if ( false === $likes ) {
    					update_post_meta( $post_id, 'switch_like_status', 0 );
    				} else {
    					delete_post_meta( $post_id, 'switch_like_status' );
    
  • /modules/likes.php line 522
     
    	$post_likes_switched = get_post_meta( $post['id'], 'switch_like_status', true );
    
    	/** This filter is documented in modules/jetpack-likes-settings.php */
    	$sitewide_likes_enabled = (bool) apply_filters( 'wpl_is_enabled_sitewide', ! get_option( 'disabled_likes' ) );
    
    	// An empty string: post meta was not set, so go with the global setting.
    	if ( '' === $post_likes_switched ) {
    		return $sitewide_likes_enabled;
    	} elseif ( '0' === $post_likes_switched ) { // User overrode the global setting to disable likes.
    		return false;
    
  • /modules/likes.php line 548
     * @param object $post_object - object containing post data.
     */
    function jetpack_post_likes_update_value( $enable_post_likes, $post_object ) {
    	/** This filter is documented in modules/jetpack-likes-settings.php */
    	$sitewide_likes_enabled = (bool) apply_filters( 'wpl_is_enabled_sitewide', ! get_option( 'disabled_likes' ) );
    
    	$should_switch_status = $enable_post_likes !== $sitewide_likes_enabled;
    
    	if ( $should_switch_status ) {
    		// Set the meta to 0 if the user wants to disable likes, 1 if user wants to enable.
    		$switch_like_status = ( $enable_post_likes ? 1 : 0 );
    
  • /sal/class.json-api-post-base.php line 752
    	 * @return bool
    	 */
    	public function is_likes_enabled() {
    		/** This filter is documented in modules/likes.php */
    		$sitewide_likes_enabled = (bool) apply_filters( 'wpl_is_enabled_sitewide', ! get_option( 'disabled_likes' ) );
    		$post_likes_switched    = get_post_meta( $this->post->ID, 'switch_like_status', true );
    
    		return $post_likes_switched || ( $sitewide_likes_enabled && '0' !== $post_likes_switched );
    	}
    
    	/**
    
  • /sal/class.json-api-site-base.php line 1244
    	 *
    	 * @return bool
    	 **/
    	public function get_default_likes_enabled() {
    		return (bool) apply_filters( 'wpl_is_enabled_sitewide', ! get_option( 'disabled_likes' ) );
    	}
    
    	/**
    	 * If sharing has been enabled and there are visible blog services (eg. 'facebook', 'twitter'), returns true.
    	 *
    	 * @return bool