PluginProbe ʕ •ᴥ•ʔ
Microsoft Clarity / 0.7
Microsoft Clarity v0.7
0.10.26 0.10.25 0.10.24 0.8.0 0.9.0 0.9.1 0.9.2 0.9.3 0.9.4 trunk 0.10.0 0.10.1 0.10.10 0.10.11 0.10.12 0.10.13 0.10.14 0.10.15 0.10.16 0.10.17 0.10.18 0.10.19 0.10.2 0.10.20 0.10.21 0.10.22 0.10.23 0.10.3 0.10.4 0.10.5 0.10.6 0.10.7 0.10.8 0.10.9 0.2 0.4 0.5 0.6 0.6.1 0.7 0.7.1 0.7.2 0.7.3 0.7.4 0.7.5
microsoft-clarity / admin / settings_callbacks.php
microsoft-clarity / admin Last commit date
index.php 5 years ago settings_callbacks.php 4 years ago settings_page.php 4 years ago
settings_callbacks.php
81 lines
1 <?php
2 /*******************************************************************************
3 * File with setting callbacks
4 *******************************************************************************/
5
6 /**
7 * Generates a settings form
8 * @param void
9 * @return HTML
10 **/
11 function clarity_admin_settings_page() {
12 if(!current_user_can('administrator')) {
13 return;
14 } else {
15 update_option("display_clarity_notice", false);
16 ?>
17 <div class="clarity_submenu_page">
18 <h1>Clarity Settings</h1>
19 <form action="options.php" method="post">
20 <?php
21 settings_fields('clarity_settings_fields');
22 do_settings_sections('clarity_settings');
23 submit_button();
24 ?>
25 </form>
26 </div>
27 <?php
28 }
29 }
30
31 /**
32 * Displays settings section
33 * @param void
34 * @return HTML
35 **/
36 function clarity_section_project_id_callback() {
37 ?>
38 <div class="clarity_submenu_page_container">
39 <p>Before you can start learning how people are using your site, we need to take a few more steps.</p>
40 <h3>Instructions</h3>
41 <ol>
42 <li>If you don't already have a project on Clarity, create a project <a href="https://clarity.microsoft.com/projects?snpf=1">here</a>.</li>
43 <li>Click on your project, and find the Wordpress installation guide under "Install tracking code on third-party platforms" in setup.</li>
44 <li>Copy your project id from the Wordpress installation guide.</li>
45 <li>Paste in the project id in the input box below.</li>
46 </ol>
47 </div>
48 <?php
49 }
50
51 function escape_value($value) {
52 return htmlspecialchars($value, ENT_QUOTES, 'UTF-8');
53 }
54
55 /**
56 * Generates a settings input for introducing the project ID
57 * @param void
58 * @return HTML
59 **/
60 function clarity_settings_field_project_id_callback($args) {
61 $p_id_option = get_option('clarity_project_id', clarity_project_id_default_value());
62 ?>
63 <input
64 type="text"
65 name="clarity_project_id"
66 value="<?php echo escape_value($p_id_option); ?>"
67 pattern="[0-9a-z]+"
68 title="Clarity project id should only contain numbers and letters." />
69 <?php
70 }
71
72 /**
73 * Generates a settings form
74 * @param void
75 * @return HTML
76 **/
77 function clarity_project_id_default_value() {
78 $default_value = '';
79 return $default_value;
80 }
81