function prepare_items() { $search = isset($_REQUEST['s']) ? $_REQUEST['s'] : ''; $per_page = 50; $paged = $this->get_pagenum(); $this->items = array(); if (($families = Genesis_Club_Fonts::get_option('families')) && is_array($families)) { foreach ($families as $key => $values) { $this->items[] = json_decode(json_encode(array('font_id' => $key) + $values), FALSE); } } else { $families = array(); } $this->set_pagination_args(array('total_items' => count($families), 'per_page' => $per_page)); }
function awesome_panel($options) { $awesome = Genesis_Club_Fonts::get_option('font_awesome'); $switch = $awesome ? 0 : 1; $status_texts = array(__('Font Awesome is currently installed', GENESIS_CLUB_DOMAIN), __('Font Awesome is currently not installed', GENESIS_CLUB_DOMAIN)); $button_texts = array(__('Remove Font Awesome', GENESIS_CLUB_DOMAIN), __('Install Font Awesome', GENESIS_CLUB_DOMAIN)); printf('<form id="%1$s" method="post" action="%2$s">%3$s%4$s%5$s%6$s</form>', $this->get_code('awesome'), $_SERVER['REQUEST_URI'] . '&action=awesome&noheader ', wp_nonce_field('awesome', 'nonce_awesome', true, false), $this->fetch_form_field('font_awesome', $switch, 'hidden'), sprintf('<div>%1$s</div>', $status_texts[$switch]), $this->submit_button($button_texts[$switch], 'update_awesome')); }