| 1 |
<?php |
| 2 |
|
| 3 |
|
| 4 |
// Tracking and Custom Code Settings |
| 5 |
|
| 6 |
add_action( 'ucd_settings_content', 'ucd_tracking_code_page' ); |
| 7 |
function ucd_tracking_code_page() { |
| 8 |
global $ucd_active_tab; |
| 9 |
if ( 'tracking-and-custom-code' != $ucd_active_tab ) |
| 10 |
return; |
| 11 |
?> |
| 12 |
|
| 13 |
<h3><?php _e( 'Tracking/Custom Code', 'ultimate-client-dash' ); ?></h3> |
| 14 |
|
| 15 |
<form action="options.php" method="post"> |
| 16 |
<?php |
| 17 |
settings_fields( 'ultimate-client-dash-tracking' ); |
| 18 |
do_settings_sections( 'ultimate-client-dash-tracking' ); |
| 19 |
$ucd_message_body = get_option( 'ucd_message_body' ); |
| 20 |
$ucd_widget_body = get_option( 'ucd_widget_body' ); |
| 21 |
?> |
| 22 |
|
| 23 |
<!-- Dashboard Styling Option Section --> |
| 24 |
|
| 25 |
<div class="ucd-inner-wrapper settings-tracking"> |
| 26 |
<p class="ucd-settings-desc">Manage websites custom code and tracking. This adds the code directly to the header of the website so you don't need to custom change any theme files. This also makes sure that you do not lose your tracking or custom code when you update your theme.</p> |
| 27 |
|
| 28 |
<div class="ucd-form-message"><?php settings_errors('ucd-notices'); ?></div> |
| 29 |
|
| 30 |
<table class="form-table"> |
| 31 |
<tbody> |
| 32 |
|
| 33 |
<tr class="ucd-title-holder"> |
| 34 |
<th><h2 class="ucd-inner-title"><?php _e( 'Tracking', 'ultimate-client-dash' ) ?></h2></th> |
| 35 |
</tr> |
| 36 |
|
| 37 |
<!-- Tracking Option Section --> |
| 38 |
<tr> |
| 39 |
<th><?php _e( 'Google Analytics ID', 'ultimate-client-dash' ) ?> |
| 40 |
<p>With this field you can monitor traffic on your website.</p> |
| 41 |
</th> |
| 42 |
<td><input class="regular-text" type="text" placeholder="UA-XXXXX-X" name="ucd_tracking_google_analytics" value="<?php echo esc_attr( get_option('ucd_tracking_google_analytics') ); ?>" size="30" /></td> |
| 43 |
</tr> |
| 44 |
|
| 45 |
<tr> |
| 46 |
<th><?php _e( 'Facebook Pixel ID', 'ultimate-client-dash' ) ?> |
| 47 |
<p>Enter your Facebook Pixel ID to track visitor activity on your website.</p> |
| 48 |
</th> |
| 49 |
<td><input class="regular-text" type="text" placeholder="" name="ucd_tracking_facebook_pixel" value="<?php echo esc_attr( get_option('ucd_tracking_facebook_pixel') ); ?>" size="30" /></td> |
| 50 |
</tr> |
| 51 |
|
| 52 |
<tr class="ucd-title-holder"> |
| 53 |
<th><h2 class="ucd-inner-title"><?php _e( 'Custom Code', 'ultimate-client-dash' ) ?></h2></th> |
| 54 |
</tr> |
| 55 |
|
| 56 |
<tr> |
| 57 |
<th><?php _e( 'Head Scripts', 'ultimate-client-dash' ) ?> |
| 58 |
<p>Enter your custom scripts here. This is not enclosed in the script tag. Can be useful for adding 3rd party scripts or Google verification codes to your website.</p> |
| 59 |
</th> |
| 60 |
<td><textarea rows="10" cols="100" type="textarea" placeholder='Example: <meta name="google-site-verification" content="your verification string">' name="ucd_tracking_custom_script" value="<?php echo esc_attr( get_option('ucd_tracking_custom_script') ); ?>" ><?php echo esc_attr( get_option('ucd_tracking_custom_script') ); ?></textarea></td> |
| 61 |
</tr> |
| 62 |
|
| 63 |
<tr> |
| 64 |
<th><?php _e( 'Frontend Custom CSS', 'ultimate-client-dash' ) ?> |
| 65 |
<p>Enter your frontend custom CSS here.</p> |
| 66 |
</th> |
| 67 |
<td><textarea rows="10" cols="100" type="textarea" placeholder="" name="ucd_tracking_custom_css" value="<?php echo esc_attr( get_option('ucd_tracking_custom_css') ); ?>" ><?php echo esc_attr( get_option('ucd_tracking_custom_css') ); ?></textarea> |
| 68 |
<p>In case if you need to overwrite any CSS setting, you can add !important at the end of CSS property. eg: color: #da2234 !important;</p> |
| 69 |
</td> |
| 70 |
</tr> |
| 71 |
|
| 72 |
<tr> |
| 73 |
<th><?php _e( 'Custom JavaScript', 'ultimate-client-dash' ) ?> |
| 74 |
<p>Enter your custom JavaScript here. This is enclosed in the script tag.</p> |
| 75 |
</th> |
| 76 |
<td><textarea rows="10" cols="100" type="textarea" placeholder="" name="ucd_tracking_custom_js" value="<?php echo esc_attr( get_option('ucd_tracking_custom_js') ); ?>" ><?php echo esc_attr( get_option('ucd_tracking_custom_js') ); ?></textarea></td> |
| 77 |
</tr> |
| 78 |
|
| 79 |
|
| 80 |
<tr class="ucd-float-option"> |
| 81 |
<th class="ucd-save-section"> |
| 82 |
<?php submit_button(); ?> |
| 83 |
</th> |
| 84 |
</tr> |
| 85 |
|
| 86 |
</tbody> |
| 87 |
</table> |
| 88 |
</div> |
| 89 |
</form> |
| 90 |
<?php } |
| 91 |
|