@@ -103,76 +103,35 @@ class="<?php echo implode( ' ', $classes ); ?>">
103103 echo esc_attr ( code_snippets_get_setting ( 'editor ' , 'theme ' ) ); ?> "><?php
104104 echo esc_html_x ( '? ' , 'help tooltip ' , 'code-snippets ' ); ?> </div>
105105
106- <?php
107-
108- $ keys = array (
109- 'Cmd ' => _x ( 'Cmd ' , 'keyboard key ' , 'code-snippets ' ),
110- 'Ctrl ' => _x ( 'Ctrl ' , 'keyboard key ' , 'code-snippets ' ),
111- 'Shift ' => _x ( 'Shift ' , 'keyboard key ' , 'code-snippets ' ),
112- 'Option ' => _x ( 'Option ' , 'keyboard key ' , 'code-snippets ' ),
113- 'Alt ' => _x ( 'Alt ' , 'keyboard key ' , 'code-snippets ' ),
114- 'F ' => _x ( 'F ' , 'keyboard key ' , 'code-snippets ' ),
115- 'G ' => _x ( 'G ' , 'keyboard key ' , 'code-snippets ' ),
116- 'R ' => _x ( 'R ' , 'keyboard key ' , 'code-snippets ' ),
117- 'S ' => _x ( 'S ' , 'keyboard key ' , 'code-snippets ' ),
118- );
119-
120- ?>
121-
122106 <div class="editor-help-text">
123107 <table>
124108 <tr>
125109 <td><?php esc_html_e ( 'Save changes ' , 'code-snippets ' ); ?> </td>
126- <td>
127- <kbd class="pc-key"><?php echo esc_html ( $ keys ['Ctrl ' ] ); ?> </kbd><kbd
128- class="mac-key"><?php echo esc_html ( $ keys ['Cmd ' ] ); ?> </kbd>‐<kbd><?php echo esc_html ( $ keys ['S ' ] ); ?> </kbd>
129- </td>
110+ <td><?php $ this ->render_keyboard_shortcut ( 'Cmd ' , 'S ' ); ?> </td>
130111 </tr>
131112 <tr>
132113 <td><?php esc_html_e ( 'Begin searching ' , 'code-snippets ' ); ?> </td>
133- <td>
134- <kbd class="pc-key"><?php echo esc_html ( $ keys ['Ctrl ' ] ); ?> </kbd><kbd
135- class="mac-key"><?php echo esc_html ( $ keys ['Cmd ' ] ); ?> </kbd>‐<kbd><?php echo esc_html ( $ keys ['F ' ] ); ?> </kbd>
136- </td>
114+ <td><?php $ this ->render_keyboard_shortcut ( 'Cmd ' , 'F ' ); ?> </td>
137115 </tr>
138116 <tr>
139117 <td><?php esc_html_e ( 'Find next ' , 'code-snippets ' ); ?> </td>
140- <td>
141- <kbd class="pc-key"><?php echo esc_html ( $ keys ['Ctrl ' ] ); ?> </kbd><kbd
142- class="mac-key"><?php echo esc_html ( $ keys ['Cmd ' ] ); ?> </kbd>‐<kbd><?php echo esc_html ( $ keys ['G ' ] ); ?> </kbd>
143- </td>
118+ <td><?php $ this ->render_keyboard_shortcut ( 'Cmd ' , 'G ' ); ?> </td>
144119 </tr>
145120 <tr>
146121 <td><?php esc_html_e ( 'Find previous ' , 'code-snippets ' ); ?> </td>
147- <td>
148- <kbd><?php echo esc_html ( $ keys ['Shift ' ] ); ?> </kbd>-<kbd
149- class="pc-key"><?php echo esc_html ( $ keys ['Ctrl ' ] ); ?> </kbd><kbd
150- class="mac-key"><?php echo esc_html ( $ keys ['Cmd ' ] ); ?> </kbd>‐<kbd><?php echo esc_html ( $ keys ['G ' ] ); ?> </kbd>
151- </td>
122+ <td><?php $ this ->render_keyboard_shortcut ( array ( 'Shift ' , 'Cmd ' ), 'G ' ); ?> </td>
152123 </tr>
153124 <tr>
154125 <td><?php esc_html_e ( 'Replace ' , 'code-snippets ' ); ?> </td>
155- <td>
156- <kbd><?php echo esc_html ( $ keys ['Shift ' ] ); ?> </kbd>‐<kbd
157- class="pc-key"><?php echo esc_html ( $ keys ['Ctrl ' ] ); ?> </kbd><kbd
158- class="mac-key"><?php echo esc_html ( $ keys ['Cmd ' ] ); ?> </kbd>‐<kbd><?php echo esc_html ( $ keys ['F ' ] ); ?> </kbd>
159- </td>
126+ <td><?php $ this ->render_keyboard_shortcut ( array ( 'Shift ' , 'Cmd ' ), 'F ' ); ?> </td>
160127 </tr>
161128 <tr>
162129 <td><?php esc_html_e ( 'Replace all ' , 'code-snippets ' ); ?> </td>
163- <td>
164- <kbd><?php echo esc_html ( $ keys ['Shift ' ] ); ?> </kbd>‐<kbd
165- class="pc-key"><?php echo esc_html ( $ keys ['Ctrl ' ] ); ?> </kbd><kbd
166- class="mac-key"><?php echo esc_html ( $ keys ['Cmd ' ] ); ?> </kbd><span
167- class="mac-key">‐</span><kbd
168- class="mac-key"><?php echo esc_html ( $ keys ['Option ' ] ); ?> </kbd>‐<kbd><?php echo esc_html ( $ keys ['R ' ] ); ?> </kbd>
169- </td>
130+ <td><?php $ this ->render_keyboard_shortcut ( array ( 'Shift ' , 'Cmd ' , 'Option ' ), 'R ' ); ?> </td>
170131 </tr>
171132 <tr>
172133 <td><?php esc_html_e ( 'Persistent search ' , 'code-snippets ' ); ?> </td>
173- <td>
174- <kbd><?php echo esc_html ( $ keys ['Alt ' ] ); ?> </kbd>‐<kbd><?php echo esc_html ( $ keys ['F ' ] ); ?> </kbd>
175- </td>
134+ <td><?php $ this ->render_keyboard_shortcut ( 'Alt ' , 'F ' ); ?> </td>
176135 </tr>
177136 </table>
178137 </div>
0 commit comments