File tree Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Original file line number Diff line number Diff line change
1
+
1
2
/* *
2
3
* Custom styling for the single snippet admin page
3
4
*/
19
20
}
20
21
}
21
22
23
+ .inactive-snippet , .active-snippet {
24
+ #title {
25
+ border-left-width : 4px ;
26
+ }
27
+ }
28
+
29
+ .active-snippet #title {
30
+ border-left-color : #46b450 ;
31
+ }
32
+
33
+
34
+ .inactive-snippet #title {
35
+ border-left-color : #dc3232 ;
36
+ }
37
+
38
+
22
39
/* Position the description heading on the same level as the editor buttons */
23
40
label [for = ' snippet_description' ] h3 div {
24
41
position : absolute ;
Original file line number Diff line number Diff line change 16
16
$ edit_id = code_snippets ()->get_menu_slug ( 'edit ' ) === $ _REQUEST ['page ' ] ? absint ( $ _REQUEST ['id ' ] ) : 0 ;
17
17
$ snippet = get_snippet ( $ edit_id );
18
18
19
+ $ classes = array ();
20
+
21
+ if ( $ edit_id ) {
22
+ $ classes [] = ( $ snippet ->active ? '' : 'in ' ) . 'active-snippet ' ;
23
+ } else {
24
+ $ classes [] = 'new-snippet ' ;
25
+ }
26
+
19
27
?>
20
28
<div class="wrap">
21
29
<h1><?php
30
38
}
31
39
?> </h1>
32
40
33
- <form method="post" id="snippet-form" action="" style="margin-top: 10px;">
41
+ <form method="post" id="snippet-form" action="" style="margin-top: 10px;" class=" <?php echo implode ( ' ' , $ classes ); ?> " >
34
42
<?php
35
43
/* Output the hidden fields */
36
44
You can’t perform that action at this time.
0 commit comments