|
20 | 20 | return; |
21 | 21 | } |
22 | 22 |
|
23 | | -$types = array_merge( [ 'all' => __( 'All Snippets', 'code-snippets' ) ], Plugin::get_types() ); |
24 | | -$current_type = $this->get_current_type(); |
| 23 | +$code_snippets_types = array_merge( [ 'all' => __( 'All Snippets', 'code-snippets' ) ], Plugin::get_types() ); |
| 24 | +$code_snippets_current_type = $this->get_current_type(); |
25 | 25 |
|
26 | 26 | if ( false !== strpos( code_snippets()->version, 'beta' ) ) { |
27 | 27 | echo '<div class="notice beta-test-notice"><p id="beta-testing">'; |
|
54 | 54 | <?php $this->print_messages(); ?> |
55 | 55 |
|
56 | 56 | <h2 class="nav-tab-wrapper" id="snippet-type-tabs"> |
57 | | - <?php |
| 57 | + <?php |
58 | 58 |
|
59 | | - Admin::render_snippet_type_tabs( $types, $current_type ); |
| 59 | + Admin::render_snippet_type_tabs( $code_snippets_types, $code_snippets_current_type ); |
60 | 60 |
|
61 | 61 | if ( ! get_setting( 'general', 'hide_upgrade_menu' ) ) { ?> |
62 | 62 | <a class="button button-large nav-tab-button nav-tab-inactive" |
|
70 | 70 |
|
71 | 71 | <?php |
72 | 72 |
|
73 | | - $type_info = [ |
74 | | - 'php' => [ |
75 | | - __( 'Function snippets are run on your site as if there were in a plugin or theme functions.php file.', 'code-snippets' ), |
76 | | - __( 'Learn more about function snippets →', 'code-snippets' ), |
77 | | - 'https://codesnippets.pro/learn-php/', |
78 | | - ], |
| 73 | + $code_snippets_type_info = [ |
| 74 | + 'php' => [ |
| 75 | + __( 'Function snippets are run on your site as if there were in a plugin or theme functions.php file.', 'code-snippets' ), |
| 76 | + __( 'Learn more about function snippets →', 'code-snippets' ), |
| 77 | + 'https://codesnippets.pro/learn-php/', |
| 78 | + ], |
79 | 79 | 'html' => [ |
80 | 80 | __( 'Content snippets are bits of reusable PHP and HTML content that can be inserted into posts and pages.', 'code-snippets' ), |
81 | 81 | __( 'Learn more about content snippets →', 'code-snippets' ), |
|
95 | 95 | __( 'See all your public and private snippets that are stored in your Code Snippet Cloud codevault.', 'code-snippets' ), |
96 | 96 | __( 'Learn more about Code Snippets Cloud →', 'code-snippets' ), |
97 | 97 | 'https://codesnippets.cloud/getstarted/', |
98 | | - ], |
99 | | - ]; |
| 98 | + ], |
| 99 | + ]; |
100 | 100 |
|
101 | 101 |
|
102 | | - if ( isset( $type_info[ $current_type ] ) ) { |
103 | | - $info = $type_info[ $current_type ]; |
| 102 | + if ( isset( $code_snippets_type_info[ $code_snippets_current_type ] ) ) { |
| 103 | + $code_snippets_current_type_info = $code_snippets_type_info[ $code_snippets_current_type ]; |
104 | 104 |
|
105 | | - printf( |
106 | | - '<p class="snippet-type-description">%s <a href="%s" target="_blank">%s</a></p>', |
107 | | - esc_html( $info[0] ), |
108 | | - esc_url( $info[2] ), |
109 | | - esc_html( $info[1] ) |
110 | | - ); |
111 | | - } |
| 105 | + printf( |
| 106 | + '<p class="snippet-type-description">%s <a href="%s" target="_blank">%s</a></p>', |
| 107 | + esc_html( $code_snippets_current_type_info[0] ), |
| 108 | + esc_url( $code_snippets_current_type_info[2] ), |
| 109 | + esc_html( $code_snippets_current_type_info[1] ) |
| 110 | + ); |
| 111 | + } |
112 | 112 |
|
113 | 113 | do_action( 'code_snippets/admin/manage/before_list_table' ); |
114 | 114 | $this->list_table->views(); |
115 | 115 |
|
116 | | - switch ( $current_type ) { |
117 | | - case 'cloud_search': |
118 | | - include_once 'partials/cloud-search.php'; |
119 | | - break; |
| 116 | + switch ( $code_snippets_current_type ) { |
| 117 | + case 'cloud_search': |
| 118 | + include_once 'partials/cloud-search.php'; |
| 119 | + break; |
120 | 120 |
|
121 | | - default: |
122 | | - include_once 'partials/list-table.php'; |
123 | | - break; |
124 | | - } |
| 121 | + default: |
| 122 | + include_once 'partials/list-table.php'; |
| 123 | + break; |
| 124 | + } |
125 | 125 |
|
126 | | - do_action( 'code_snippets/admin/manage', $current_type ); |
| 126 | + do_action( 'code_snippets/admin/manage', $code_snippets_current_type ); |
127 | 127 |
|
128 | 128 | ?> |
129 | 129 | </div> |
0 commit comments