Skip to Content

linkedin_follow()

Generate a native LinkedIn follow button.

PHP March 16, 2017

Usage

PHP
nebula()->linkedin_follow($counts)

Parameters

$counts
(Optional) (Boolean) Whether to show count bubbles
Default: false

Request or provide clarification »

Examples

Only show count bubbles to staff.

PHP
<?php nebula()->linkedin_follow(nebula()->is_staff()); ?>

Source File

Located in /libs/Functions.php on line 1156.

1 Hook

Find these filters and actions in the source code below to hook into them. Use do_action() and add_filter() in your functions file or plugin.

Filters
"pre_nebula_linkedin_follow"
Need a new filter hook? Request one here.

Actions
This function has no action hooks available. Request one?

PHP
    public function linkedin_follow($counts=0){
        $override = apply_filters('pre_nebula_linkedin_follow', null, $counts);
        if ( isset($override) ){return;}
        ?>
        <div class="nebula-social-button linkedin-follow">
            <?php $this->linkedin_widget_script(); ?>
            <script type="IN/FollowCompany" data-id="1337" <?php echo ( $counts !== 0 )? 'data-counter="right"' : ''; ?>></script>
        </div>
        <?php
    }

Override

To override this PHP function, use this hook in your child theme or plugin ("my_custom" can be changed):

PHP
add_filter('pre_nebula_linkedin_follow', 'my_custom_linkedin_follow', 10, 2); //The last integer must be 1 more than the actual parameters
function my_custom_linkedin_follow($null, $counts){ //$null is required, but can be ignored
    //Write your own code here

    return true; //Return true to prevent the original function from running afterwords
}

You can completely disable this PHP function with a single line actions:

PHP
 add_filter('pre_nebula_linkedin_follow', '__return_false');