PluginProbe ʕ •ᴥ•ʔ
Microsoft Clarity / 0.5
Microsoft Clarity v0.5
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 5 years ago
settings_callbacks.php
82 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 ?>
24 <?php
25 submit_button();
26 ?>
27 </form>
28 </div>
29 <?php
30 }
31 }
32
33 /**
34 * Displays settings section
35 * @param void
36 * @return HTML
37 **/
38 function clarity_section_project_id_callback(){
39 ?>
40 <div class="clarity_submenu_page_container">
41 <p>Before you can start learning how people are using your site, we need to take a few more steps.</p>
42 <h3>Instructions</h3>
43 <ol>
44 <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>
45 <li>Click on your project, and find the Wordpress installation guide under "Install tracking code on third-party platforms" in setup.</li>
46 <li>Copy your project id from the Wordpress installation guide.</li>
47 <li>Paste in the project id in the input box below.</li>
48 <?php
49 ?>
50 </ol>
51 </div>
52 <?php
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="<?= $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 /**
74 * Generates a settings form
75 * @param void
76 * @return HTML
77 **/
78 function clarity_project_id_default_value(){
79 $default_value = '';
80 return $default_value;
81 }
82