コード例 #1
0
ファイル: config.php プロジェクト: xalgorithm/amcf-wp

			<tr valign="top" class="group_general tab_content">
				<th scope="row"><?php 
esc_html_e('Google Analytics Web Property ID', 'better-analytics');
?>
</th>
				<td>
					<input type="text" name="better_analytics[property_id]" id="ba_property_id" placeholder="UA-000000-01" style="width:25%;min-width:110px;" value="<?php 
echo esc_attr(@$betterAnalyticsOptions['property_id']);
?>
" />
					<?php 
$profilePick = array();
if (!empty($profiles['items'])) {
    $profilePick = DigitalPointBetterAnalytics_Base_Admin::getProfilePropertyIds($profiles['items']);
}
if ($profilePick) {
    $siteHostname = parse_url(site_url(), PHP_URL_HOST);
    echo '<select data-placeholder="' . esc_html__('Pick profile', 'better-analytics') . '" id="ba_pick_profile" class="chosen-select">';
    echo '<option value="">' . esc_html__('please pick a profile', 'better-analytics') . '</option>';
    foreach ($profilePick as $key => $profile) {
        $profileHostname = parse_url($profile[0], PHP_URL_HOST);
        echo '<optgroup label="' . htmlentities($profile[0]) . '"><option value="' . $key . '"' . ($profileHostname == $siteHostname ? ' style="background-color:#ffffc8"' : '') . '' . ($key == @$betterAnalyticsOptions['property_id'] ? ' selected="selected"' : '') . '>' . htmlentities($profile[1] . ' (' . $key . ')') . '</option></optgroup>';
    }
    echo '</select>';
} else {
    echo '<a id="ba_select_profile" class="button" href="' . menu_page_url('better-analytics_auth', false) . '">' . esc_html__('Link Your Google Analytics Account', 'better-analytics') . '</a>';
}
?>
				</td>