/** * Return HTML markup for the networks. * @since 1.0.0 * @return string HTML markup. */ function subscribe_and_connect_get_networks() { global $subscribe_and_connect; $settings = $subscribe_and_connect->get_settings(); $networks = Subscribe_And_Connect_Utils::get_networks_in_order($settings['connect']['networks'], $settings['connect']['networks_order']); $list = ''; if (0 < count($networks)) { foreach ($networks as $k => $v) { if (!isset($v['url']) || '' == $v['url']) { continue; } $class = $k; $list .= '<li class="' . esc_attr($class) . '"><a href="' . esc_url($v['url']) . '"><span>' . "\n"; $list .= '</span></a></li>' . "\n"; } } $html = ''; if ('' != $list) { $theme = 'icons'; $list = apply_filters('subscribe_and_connect_networks_list', $list, $settings, $theme, $networks); // Parse and apply the icon theme, if applicable. if ($subscribe_and_connect->context->is_valid_theme($settings['display']['theme'])) { $theme = $subscribe_and_connect->context->get_sanitized_theme_key($settings['display']['theme']); } $html .= '<ul class="icons ' . esc_attr('icon-theme-' . $theme) . '">' . "\n"; $html .= $list; $html .= '</ul><!--/.icons-->' . "\n"; } return $html; }
/** * form_field_network function. * * @access public * @since 1.0.0 * @param array $args * @return void */ public function form_field_network($args) { $options = $this->get_settings(); $networks = Subscribe_And_Connect_Utils::get_supported_networks(); $html = ''; $order = ''; if (isset($options['networks_order'])) { $order = $options['networks_order']; } $networks = Subscribe_And_Connect_Utils::get_networks_in_order($networks, $order); if (0 < count($networks)) { $html .= '<table class="form-table widefat subscribe-and-connect-network-fields"><thead><tr><th class="title">' . __('Social Network', 'woothemes-wc') . '</th><th class="title">' . __('Your URL', 'woothemes-wc') . '</th></tr></thead><tbody>' . "\n"; foreach ($networks as $k => $v) { $html .= $this->_single_network_field($k, $v, $args, $options); } $html .= '</tbody></table>' . "\n"; } // Used to store the placeholder image temporarily, for use with JavaScript. $html .= '<img src="' . esc_url(Subscribe_And_Connect_Utils::get_placeholder_image()) . '" class="subscribe-and-connect-placeholder-image" style="display: none;" width="0" height="0" />' . "\n"; echo $html; if (isset($args['data']['description'])) { echo '<p class="description">' . wp_kses_post($args['data']['description']) . '</p>' . "\n"; } }