-
-
Save mrkdevelopment/af79c7148574aab03771a3d52cd0239f to your computer and use it in GitHub Desktop.
/** | |
* Loads theme settings | |
* | |
*/ | |
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') { | |
$showOptions = array( | |
"name" =>esc_html__( "Show Linked In Icon", $themename ), | |
"id" => $shortname."_show_linkedin_icon", | |
"type" => "checkbox2", | |
"std" => "on", | |
"desc" =>esc_html__( "Here you can choose to display the LINKED IN Icon. ", $themename ) ); | |
$newOptions[] = $showOptions; | |
$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; | |
} | |
if (isset($optionArray['id']) && $optionArray['id'] == 'divi_google_url') { | |
$urlOptions = array( "name" =>esc_html__( "Linked In Profile Url", $themename ), | |
"id" => $shortname."_linkedin_url", | |
"std" => "#", | |
"type" => "text", | |
"validation_type" => "url", | |
"desc" =>esc_html__( "Enter the URL of your LinkedIn Profile. ", $themename ) ); | |
$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[] = $urlOptions; | |
$newOptions[] = $urlOptions2; | |
} | |
} | |
$options = $newOptions; | |
} | |
} |
Except for some reason it added the icon options 4 times???
Hi @vsmith72 ;) did you resolved the multiple times issue?
Hi Guys, We managed to fix this. For some reason I don't get notifications when people comment on Gist's. That's odd.
Thank you! This was very helpful!
Thanks Rameyrobo. BTW - we have a free plugin now that handles all of this which may interest readers.https://www.mrkwp.com/wp/divi-icon-toolkit/
For "multiple times" issue just change "require_once" to "require".
For newer Divi versions, you can change divi_show_google_icon
to divi_show_instagram_icon
and divi_google_url
to divi_instagram_url
Hello @mrkdevelopment , Is it possible to clarify the licensing of the code?
Its GPL - you can do what ever you want with it.
Thanks Rameyrobo. BTW - we have a free plugin now that handles all of this which may interest readers.https://www.mrkwp.com/wp/divi-icon-toolkit/
FYI, that URL doesn't resolve, searched your site and couldn't find the toolkit either.
@ExponentiallyDigital I no longer have the plugin. The code is here as a GPL snippet but I have no idea if it still works. You may find some alternatives on the divi marketplace.
Oh yeah and thanks this is cool!