Обрезать скрипт авторизированным юзерам
Код:
function oa_social_login_add_javascripts ()
{
if (!wp_script_is ('oa_social_library', 'registered'))
{
//Read settings
$settings = get_option ('oa_social_login_settings');
if (!empty ($settings ['api_subdomain']))
{
//Include in header, without having the version appended
wp_register_script ('oa_social_library', ((oa_social_login_https_on () ? 'https' : 'http') . '://' . $settings ['api_subdomain'] . '.api.oneall.com/socialize/library.js'), array (), null, false);
}
}
wp_print_scripts ('oa_social_library');
}
//This is for Social Login
add_action ('login_head', 'oa_social_login_add_javascripts');
add_action ('wp_head', 'oa_social_login_add_javascripts');
{
if (!wp_script_is ('oa_social_library', 'registered'))
{
//Read settings
$settings = get_option ('oa_social_login_settings');
if (!empty ($settings ['api_subdomain']))
{
//Include in header, without having the version appended
wp_register_script ('oa_social_library', ((oa_social_login_https_on () ? 'https' : 'http') . '://' . $settings ['api_subdomain'] . '.api.oneall.com/socialize/library.js'), array (), null, false);
}
}
wp_print_scripts ('oa_social_library');
}
//This is for Social Login
add_action ('login_head', 'oa_social_login_add_javascripts');
add_action ('wp_head', 'oa_social_login_add_javascripts');