PluginProbe
Code Snippets / 3.6.3
Code Snippets v3.6.3
3.10.2 3.10.1 3.10.0 3.10.0-beta.2 3.10.0-beta.1 4.0.0-beta.1 3.9.6 trunk 2.10.0 2.10.1 2.12.0 2.12.1 2.13.0 2.13.1 2.13.2 2.13.3 2.14.0 2.14.1 2.14.2 2.14.3 2.14.4 2.14.5 2.14.6 3.0.0 3.0.1 All 64 releases
code-snippets / php / views / manage.php

manage.php in Code Snippets 3.6.3, at php/views/manage.php

125 lines 3.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * HTML for the Manage Snippets page.
4 *
5 * @package Code_Snippets
6 * @subpackage Views
7 */
8
9 namespace Code_Snippets;
10
11 /**
12 * Loaded from the Manage_Menu class.
13 *
14 * @var Manage_Menu $this
15 */
16
17 if ( ! defined( 'ABSPATH' ) ) {
18 return;
19 }
20
21 $types = array_merge( [ 'all' => __( 'All Snippets', 'code-snippets' ) ], Plugin::get_types() );
22 $current_type = $this->get_current_type();
23
24 if ( false !== strpos( code_snippets()->version, 'beta' ) ) {
25 echo '<div class="notice beta-test-notice"><p id="beta-testing">';
26 echo wp_kses(
27 __( 'Thank you for testing this <span class="highlight-yellow">beta version of Code Snippets</span>. We would love to hear your feedback.', 'code-snippets' ),
28 [ 'span' => [ 'class' => [ 'highlight-yellow' ] ] ]
29 );
30
31 $feedback_url = __( 'mailto:team@codesnippets.pro?subject=Code Snippet Beta Test Feedback', 'code-snippets' );
32 printf( ' <a href="%s">%s</a>', esc_url( $feedback_url ), esc_html__( 'Click here to submit your feedback', 'code-snippets' ) );
33 echo '</p></div>';
34 }
35
36 ?>
37
38 <div class="wrap">
39 <h1>
40 <?php
41 esc_html_e( 'Snippets', 'code-snippets' );
42
43 $this->render_page_title_actions( code_snippets()->is_compact_menu() ? [ 'add', 'import', 'settings' ] : [ 'add', 'import' ] );
44
45 $this->list_table->search_notice();
46 ?>
47 </h1>
48
49 <?php $this->print_messages(); ?>
50
51 <h2 class="nav-tab-wrapper" id="snippet-type-tabs">
52 <?php
53
54 foreach ( $types as $type_name => $label ) {
55 Admin::render_snippet_type_tab( $type_name, $label, $current_type );
56 }
57
58 ?>
59 <a class="button button-large nav-tab-button nav-tab-inactive go-pro-button"
60 href="https://codesnippets.pro/pricing/" target="_blank"
61 title="<?php esc_html_e( 'Find more about Pro (opens in external tab)', 'code-snippets' ); ?>">
62 <?php echo wp_kses( __( 'Upgrade to <span class="badge">Pro</span>', 'code-snippets' ), [ 'span' => [ 'class' => 'badge' ] ] ); ?>
63 <span class="dashicons dashicons-external"></span>
64 </a>
65 </h2>
66
67 <?php
68
69 $type_info = [
70 'php' => [
71 __( 'Function snippets are run on your site as if there were in a plugin or theme functions.php file.', 'code-snippets' ),
72 __( 'Learn more about function snippets &rarr;', 'code-snippets' ),
73 'https://codesnippets.pro/learn-php/',
74 ],
75 'html' => [
76 __( 'Content snippets are bits of reusable PHP and HTML content that can be inserted into posts and pages.', 'code-snippets' ),
77 __( 'Learn more about content snippets &rarr;', 'code-snippets' ),
78 'https://codesnippets.pro/learn-html/',
79 ],
80 'css' => [
81 __( 'Style snippets are written in CSS and loaded in the admin area or on the site front-end, just like the theme style.css.', 'code-snippets' ),
82 esc_html__( 'Learn more about style snippets &rarr;', 'code-snippets' ),
83 'https://codesnippets.pro/learn-css/',
84 ],
85 'js' => [
86 __( 'Script snippets are loaded on the site front-end in a JavaScript file, either in the head or body sections.', 'code-snippets' ),
87 __( 'Learn more about javascript snippets &rarr;', 'code-snippets' ),
88 'https://codesnippets.pro/learn-js/',
89 ],
90 'cloud' => [
91 __( 'See all your public and private snippets that are stored in your Code Snippet Cloud codevault.', 'code-snippets' ),
92 __( 'Learn more about Code Snippets Cloud &rarr;', 'code-snippets' ),
93 'https://codesnippets.cloud/getstarted/',
94 ],
95 ];
96
97
98 if ( isset( $type_info[ $current_type ] ) ) {
99 $info = $type_info[ $current_type ];
100
101 printf(
102 '<p class="snippet-type-description">%s <a href="%s" target="_blank">%s</a></p>',
103 esc_html( $info[0] ),
104 esc_url( $info[2] ),
105 esc_html( $info[1] )
106 );
107 }
108
109 do_action( 'code_snippets/admin/manage/before_list_table' );
110 $this->list_table->views();
111
112 switch ( $current_type ) {
113 case 'cloud_search':
114 include_once 'partials/cloud-search.php';
115 break;
116
117 default:
118 include_once 'partials/list-table.php';
119 break;
120 }
121
122 do_action( 'code_snippets/admin/manage' );
123 ?>
124 </div>
125