Usage
PHP
nebula()->social_url($network);
Parameters
$network
(Required) (String) Which social network to return a URL for
Default: None
Parameter Notes
Options for the $network parameter include full names and abbreviations of social networks including (for example) “facebook” and “fb”.
Examples
Retrieve the Twitter URL
HTML
<a href="<?php echo nebula()->social_url('twitter'); ?>" target="_blank">
Additional Notes
Has an alias of social_link().
Source File
Located in /libs/Functions.php on line 1188.
No Hooks
This function does not have any filters or actions available. Request one?
PHP
public function social_url($network){
switch ( strtolower($network) ){
case 'facebook':
case 'fb':
return esc_url($this->get_option('facebook_url', ''));
case 'twitter':
case 'x':
return $this->twitter_url(); //Use the provided function from Nebula Options
case 'linkedin':
return esc_url($this->get_option('linkedin_url', ''));
case 'instagram':
case 'ig':
return esc_url($this->get_option('instagram_url', ''));
case 'pinterest':
return esc_url($this->get_option('pinterest_url', ''));
case 'youtube':
return esc_url($this->get_option('youtube_url', ''));
case 'tiktok':
return esc_url($this->get_option('tiktok_url', ''));
case 'wikipedia':
return esc_url($this->get_option('wikipedia_url', ''));
default:
return null;
}
return null;
}
Override
This function can not be short-circuited with an override filter. Request one?