@@ -116,7 +116,7 @@ private function get_snippet_action_links( Snippet $snippet ) {
116
116
if ( $ snippet ->active ) {
117
117
$ actions ['deactivate ' ] = sprintf (
118
118
$ link_format ,
119
- $ snippet ->network ? __ ( 'Network Deactivate ' , 'code-snippets ' ) : __ ( 'Deactivate ' , 'code-snippets ' ),
119
+ $ snippet ->network ? esc_html__ ( 'Network Deactivate ' , 'code-snippets ' ) : esc_html__ ( 'Deactivate ' , 'code-snippets ' ),
120
120
esc_url ( add_query_arg ( array (
121
121
'action ' => 'deactivate ' ,
122
122
'id ' => $ snippet ->id ,
@@ -125,7 +125,7 @@ private function get_snippet_action_links( Snippet $snippet ) {
125
125
} else {
126
126
$ actions ['activate ' ] = sprintf (
127
127
$ link_format ,
128
- $ snippet ->network ? __ ( 'Network Activate ' , 'code-snippets ' ) : __ ( 'Activate ' , 'code-snippets ' ),
128
+ $ snippet ->network ? esc_html__ ( 'Network Activate ' , 'code-snippets ' ) : esc_html__ ( 'Activate ' , 'code-snippets ' ),
129
129
esc_url ( add_query_arg ( array (
130
130
'action ' => 'activate ' ,
131
131
'id ' => $ snippet ->id ,
@@ -135,13 +135,13 @@ private function get_snippet_action_links( Snippet $snippet ) {
135
135
136
136
$ actions ['edit ' ] = sprintf (
137
137
$ link_format ,
138
- __ ( 'Edit ' , 'code-snippets ' ),
138
+ esc_html__ ( 'Edit ' , 'code-snippets ' ),
139
139
code_snippets ()->get_snippet_edit_url ( $ snippet ->id )
140
140
);
141
141
142
142
$ actions ['export ' ] = sprintf (
143
143
$ link_format ,
144
- __ ( 'Export ' , 'code-snippets ' ),
144
+ esc_html__ ( 'Export ' , 'code-snippets ' ),
145
145
esc_url ( add_query_arg ( array (
146
146
'action ' => 'export ' ,
147
147
'id ' => $ snippet ->id ,
@@ -150,24 +150,24 @@ private function get_snippet_action_links( Snippet $snippet ) {
150
150
151
151
$ actions ['delete ' ] = sprintf (
152
152
'<a href="%2$s" class="delete" onclick="%3$s">%1$s</a> ' ,
153
- __ ( 'Delete ' , 'code-snippets ' ),
153
+ esc_html__ ( 'Delete ' , 'code-snippets ' ),
154
154
esc_url ( add_query_arg ( array (
155
155
'action ' => 'delete ' ,
156
156
'id ' => $ snippet ->id ,
157
157
) ) ),
158
158
esc_js ( sprintf (
159
159
'return confirm("%s"); ' ,
160
- __ ( 'You are about to permanently delete the selected item. ' , 'code-snippets ' ) . "\n" .
161
- __ ( "'Cancel' to stop, 'OK' to delete. " , 'code-snippets ' )
160
+ esc_html__ ( 'You are about to permanently delete the selected item. ' , 'code-snippets ' ) . "\n" .
161
+ esc_html__ ( "'Cancel' to stop, 'OK' to delete. " , 'code-snippets ' )
162
162
) )
163
163
);
164
164
165
165
} else {
166
166
167
167
if ( $ snippet ->active ) {
168
- $ actions ['network_active ' ] = __ ( 'Network Active ' , 'code-snippets ' );
168
+ $ actions ['network_active ' ] = esc_html__ ( 'Network Active ' , 'code-snippets ' );
169
169
} else {
170
- $ actions ['network_only ' ] = __ ( 'Network Only ' , 'code-snippets ' );
170
+ $ actions ['network_only ' ] = esc_html__ ( 'Network Only ' , 'code-snippets ' );
171
171
}
172
172
}
173
173
@@ -188,7 +188,7 @@ private function get_shared_network_snippet_action_links( Snippet $snippet ) {
188
188
if ( ! $ this ->is_network ) {
189
189
190
190
$ action = $ snippet ->active ? 'deactivate ' : 'activate ' ;
191
- $ label = $ snippet ->active ? __ ( 'Deactivate ' , 'code-snippets ' ) : __ ( 'Activate ' , 'code-snippets ' );
191
+ $ label = $ snippet ->active ? esc_html__ ( 'Deactivate ' , 'code-snippets ' ) : esc_html__ ( 'Activate ' , 'code-snippets ' );
192
192
$ activate_url = add_query_arg ( array (
193
193
'action ' => $ action . '-shared ' ,
194
194
'id ' => $ snippet ->id ,
@@ -204,13 +204,13 @@ private function get_shared_network_snippet_action_links( Snippet $snippet ) {
204
204
205
205
$ actions ['edit ' ] = sprintf (
206
206
$ link_format ,
207
- __ ( 'Edit ' , 'code-snippets ' ),
207
+ esc_html__ ( 'Edit ' , 'code-snippets ' ),
208
208
code_snippets ()->get_snippet_edit_url ( $ snippet ->id , 'network ' )
209
209
);
210
210
211
211
$ actions ['export ' ] = sprintf (
212
212
$ link_format ,
213
- __ ( 'Export ' , 'code-snippets ' ),
213
+ esc_html__ ( 'Export ' , 'code-snippets ' ),
214
214
add_query_arg (
215
215
array (
216
216
'action ' => 'export ' ,
@@ -222,7 +222,7 @@ private function get_shared_network_snippet_action_links( Snippet $snippet ) {
222
222
223
223
$ actions ['delete ' ] = sprintf (
224
224
'<a href="%2$s" class="delete" onclick="%3$s">%1$s</a> ' ,
225
- __ ( 'Delete ' , 'code-snippets ' ),
225
+ esc_html__ ( 'Delete ' , 'code-snippets ' ),
226
226
add_query_arg (
227
227
array (
228
228
'action ' => 'delete ' ,
@@ -232,8 +232,8 @@ private function get_shared_network_snippet_action_links( Snippet $snippet ) {
232
232
),
233
233
esc_js ( sprintf (
234
234
'return confirm("%s"); ' ,
235
- __ ( 'You are about to permanently delete the selected item. ' , 'code-snippets ' ) . "\n" .
236
- __ ( "'Cancel' to stop, 'OK' to delete. " , 'code-snippets ' )
235
+ esc_html__ ( 'You are about to permanently delete the selected item. ' , 'code-snippets ' ) . "\n" .
236
+ esc_html__ ( "'Cancel' to stop, 'OK' to delete. " , 'code-snippets ' )
237
237
) )
238
238
);
239
239
@@ -258,11 +258,17 @@ protected function column_name( $snippet ) {
258
258
apply_filters ( 'code_snippets/list_table/row_actions_always_visible ' , true )
259
259
);
260
260
261
- $ out = sprintf (
262
- '<a href="%s"><strong>%s</strong></a> ' ,
263
- code_snippets ()->get_snippet_edit_url ( $ snippet ->id , $ snippet ->network ? 'network ' : 'admin ' ),
264
- $ title
265
- );
261
+ $ out = sprintf ('<strong>%s</strong> ' , esc_html ( $ title ) );
262
+
263
+ /* Add a link to the snippet if it isn't an unreadable network-only snippet */
264
+ if ( $ this ->is_network || ! $ snippet ->network || current_user_can ( code_snippets ()->get_network_cap_name () ) ) {
265
+
266
+ $ out = sprintf (
267
+ '<a href="%s"><strong>%s</strong></a> ' ,
268
+ code_snippets ()->get_snippet_edit_url ( $ snippet ->id , $ snippet ->network ? 'network ' : 'admin ' ),
269
+ $ title
270
+ );
271
+ }
266
272
267
273
if ( $ snippet ->shared_network && ! current_user_can ( apply_filters ( 'code_snippets_network_cap ' , 'manage_network_snippets ' ) ) ) {
268
274
$ out = sprintf ( '<a><strong>%s</strong></a> ' , $ title );
0 commit comments