function get_google_fonts() { $google_fonts = get_transient($this->google_transient); if (false === $google_fonts || empty($google_fonts)) { // It wasn't there, so regenerate the data and save the transient $api_key = bon_get_framework_option('bon_framework_google_api'); if (empty($api_key)) { $api_key = 'AIzaSyBIluei6yjgNvocIeSargnbOZHfSxy_HTg'; } $google_fonts = $this->fetch_google_fonts('all', 'alpha', $api_key); if (!empty($google_fonts)) { set_transient($this->google_transient, $google_fonts, WEEK_IN_SECONDS * 4); // store for a month in transient } } return $google_fonts; }
public function theme_updater() { if (bon_get_framework_option('bon_framework_update_notification') == true) { require_once trailingslashit(BON_CLASSES) . 'class-pixelentity-theme-update.php'; $username = bon_get_framework_option('bon_framework_envato_username'); $apikey = bon_get_framework_option('bon_framework_envato_api'); $author = $this->author_name; if (!empty($username) && !empty($apikey)) { PixelentityThemeUpdate::init($username, $apikey, $author); } } }
function bon_login_css() { $logo = bon_get_framework_option('bon_framework_custom_login_logo'); if (!empty($logo)) { echo '<style type="text/css"> h1 a { background-image:url(' . $logo . ') !important; } </style>'; } }
function admin_bar_menu($admin_bar) { global $current_user; $current_user_id = $current_user->user_login; $super_user = bon_get_framework_option('bon_framework_super_user'); $parent = ucwords($this->theme_name); foreach ($this->option_pages as $_key => $_value) { if ($_key === 0) { $level = $_value['slug']; $admin_bar->add_node($parent, admin_url('admin.php?page=' . $_value['slug'])); } if ($_value['parent'] == $_value['slug']) { if ($_value['role'] === 'superuser') { if (!empty($super_user) && $super_user != $current_user_id) { continue; } else { $_value['role'] = 'update_core'; } } $admin_bar->add_node($_value['title'], admin_url('admin.php?page=' . $_value['slug']), $parent); } } }