function _addtoany_create_script in AddToAny Share Buttons 7.3
Same name and namespace in other branches
- 5.0 addtoany.module \_addtoany_create_script()
- 6.3 addtoany.module \_addtoany_create_script()
- 6.2 addtoany.module \_addtoany_create_script()
- 7.4 addtoany.module \_addtoany_create_script()
- 7 addtoany.module \_addtoany_create_script()
Internal function to call the async script loading function right after the first AddToAny instance, to utilize concurrent downloading and increase overall page-load performance.
Parameters
object $id_num:
object $link_name:
object $link_url:
Return value
String containing a JavaScript function call for asynchronous script loading right after the first instance.
1 call to _addtoany_create_script()
- _addtoany_create_button in ./
addtoany.module - Internal function to generate code for AddToAny buttons
File
- ./
addtoany.module, line 190 - Stand alone module file to handle AddToAny buttons integration
Code
function _addtoany_create_script($id_num, $link_name, $link_url) {
global $_addtoany_targets, $_addtoany_init;
if (!isset($_addtoany_targets)) {
$_addtoany_targets = array();
}
$_addtoany_targets[] = "\n{title:'" . check_plain($link_name) . "'," . "url:'" . check_plain($link_url) . "'}";
if (!$_addtoany_init) {
$javascript_load_early = "<script type=\"text/javascript\">\n" . "<!--//--><![CDATA[//><!--\n" . "da2a.script_load();\n" . "//--><!]]>\n" . "</script>";
}
else {
$javascript_load_early = "";
}
$_addtoany_init = TRUE;
return $javascript_load_early;
}