Forked from mrkdevelopment/In your social icons file
Last active
February 22, 2019 04:32
-
-
Save resonancedesigns/03d428220b7cfb542930116b649ef262 to your computer and use it in GitHub Desktop.
Divi child theme social icons extension
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Additional theme settings | |
* Add this section to your functions file and modify as needed. | |
* | |
*/ | |
if ( ! function_exists( 'et_load_core_options' ) ) { | |
function et_load_core_options() { | |
global $shortname, $themename; | |
require_once get_template_directory() . esc_attr( "/options_{$shortname}.php" ); | |
$newOptions = []; | |
foreach ($options as $i => $optionArray) { | |
$newOptions[] = $optionArray; | |
if (isset($optionArray['id']) && $optionArray['id'] == 'divi_show_google_icon') { | |
/* Spotify Icon */ | |
$showOptions = array( | |
"name" =>esc_html__( "Show Spotify Icon", $themename ), | |
"id" => $shortname."_show_spotify_icon", | |
"type" => "checkbox2", | |
"std" => "on", | |
"desc" =>esc_html__( "Here you can choose to display the Spotify Icon. ", $themename ) ); | |
$newOptions[] = $showOptions; | |
/* Youtube Icon */ | |
$showOptions2 = array( | |
"name" =>esc_html__( "Show Youtube Icon", $themename ), | |
"id" => $shortname."_show_youtube_icon", | |
"type" => "checkbox2", | |
"std" => "on", | |
"desc" =>esc_html__( "Here you can choose to display the Youtube Icon. ", $themename ) ); | |
$newOptions[] = $showOptions2; | |
/* Soundcloud Icon */ | |
$showOptions3 = array( | |
"name" =>esc_html__( "Show Soundcloud Icon", $themename ), | |
"id" => $shortname."_show_soundcloud_icon", | |
"type" => "checkbox2", | |
"std" => "on", | |
"desc" =>esc_html__( "Here you can choose to display the Soundcloud Icon. ", $themename ) ); | |
$newOptions[] = $showOptions3; | |
/* Google Play Icon */ | |
$showOptions4 = array( | |
"name" =>esc_html__( "Show Google Play Icon", $themename ), | |
"id" => $shortname."_show_googleplay_icon", | |
"type" => "checkbox2", | |
"std" => "on", | |
"desc" =>esc_html__( "Here you can choose to display the Google Play Icon. ", $themename ) ); | |
$newOptions[] = $showOptions4; | |
/* iTunes Icon */ | |
$showOptions5 = array( | |
"name" =>esc_html__( "Show iTunes Icon", $themename ), | |
"id" => $shortname."_show_itunes_icon", | |
"type" => "checkbox2", | |
"std" => "on", | |
"desc" =>esc_html__( "Here you can choose to display the iTunes Icon. ", $themename ) ); | |
$newOptions[] = $showOptions5; | |
/* Stitcher Icon */ | |
$showOptions6 = array( | |
"name" =>esc_html__( "Show Stitcher Icon", $themename ), | |
"id" => $shortname."_show_stitcher_icon", | |
"type" => "checkbox2", | |
"std" => "on", | |
"desc" =>esc_html__( "Here you can choose to display the Stitcher Icon. ", $themename ) ); | |
$newOptions[] = $showOptions6; | |
} | |
if (isset($optionArray['id']) && $optionArray['id'] == 'divi_google_url') { | |
/* Spotify URL */ | |
$urlOptions = array( | |
"name" =>esc_html__( "Spotify Page Url", $themename ), | |
"id" => $shortname."_spotify_url", | |
"std" => "#", | |
"type" => "text", | |
"validation_type" => "url", | |
"desc" =>esc_html__( "Enter the URL of your Spotify page. ", $themename ) ); | |
$newOptions[] = $urlOptions; | |
/* Youtube URL */ | |
$urlOptions2 = array( | |
"name" =>esc_html__( "Youtube Url", $themename ), | |
"id" => $shortname."_youtube_url", | |
"std" => "#", | |
"type" => "text", | |
"validation_type" => "url", | |
"desc" =>esc_html__( "Enter the URL of your Youtube Channel. ", $themename ) ); | |
$newOptions[] = $urlOptions2; | |
/* Soundcloud URL */ | |
$urlOptions3 = array( | |
"name" =>esc_html__( "Soundcloud Url", $themename ), | |
"id" => $shortname."_soundcloud_url", | |
"std" => "#", | |
"type" => "text", | |
"validation_type" => "url", | |
"desc" =>esc_html__( "Enter the URL of your Soundcloud page. ", $themename ) ); | |
$newOptions[] = $urlOptions3; | |
/* Google Play URL */ | |
$urlOptions4 = array( | |
"name" =>esc_html__( "Google Play Url", $themename ), | |
"id" => $shortname."_googleplay_url", | |
"std" => "#", | |
"type" => "text", | |
"validation_type" => "url", | |
"desc" =>esc_html__( "Enter the URL of your Google Play profile. ", $themename ) ); | |
$newOptions[] = $urlOptions4; | |
/* iTunes URL */ | |
$urlOptions5 = array( | |
"name" =>esc_html__( "iTunes Url", $themename ), | |
"id" => $shortname."_itunes_url", | |
"std" => "#", | |
"type" => "text", | |
"validation_type" => "url", | |
"desc" =>esc_html__( "Enter the URL of your iTunes page. ", $themename ) ); | |
$newOptions[] = $urlOptions5; | |
/* Stitcher URL */ | |
$urlOptions6 = array( | |
"name" =>esc_html__( "Stitcher Url", $themename ), | |
"id" => $shortname."_stitcher_url", | |
"std" => "#", | |
"type" => "text", | |
"validation_type" => "url", | |
"desc" =>esc_html__( "Enter the URL of your Stitcher profile. ", $themename ) ); | |
$newOptions[] = $urlOptions6; | |
} | |
} | |
$options = $newOptions; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment