* HTML for the Manage Snippets page.
use function Code_Snippets\Settings\get_setting;
* Loaded from the manage menu class.
if ( ! defined( 'ABSPATH' ) ) {
$types = array_merge( [ 'all' => __( 'All Snippets', 'code-snippets' ) ], Plugin::get_types() );
$current_type = $this->get_current_type();
if ( false !== strpos( code_snippets()->version, 'beta' ) ) {
echo '<div class="notice beta-test-notice"><p id="beta-testing">';
__( 'Thank you for testing this <span class="highlight-yellow">beta version of Code Snippets</span>. We would love to hear your thoughts.', 'code-snippets' ),
[ 'span' => [ 'class' => [ 'highlight-yellow' ] ] ]
' <a href="%s" class="button button-secondary" target="_blank">%s</a>',
esc_url( __( 'https://codesnippets.pro/beta-testing/feedback/', 'code-snippets' ) ),
esc_html__( 'Share feedback', 'code-snippets' )
esc_html_e( 'Snippets', 'code-snippets' );
$this->render_page_title_actions( code_snippets()->is_compact_menu() ? [ 'add', 'import', 'settings' ] : [ 'add', 'import' ] );
$this->list_table->search_notice();
<?php $this->print_messages(); ?>
<h2 class="nav-tab-wrapper" id="snippet-type-tabs">
Admin::render_snippet_type_tabs( $types, $current_type );
if ( ! get_setting( 'general', 'hide_upgrade_menu' ) ) { ?>
<a class="button button-large nav-tab-button nav-tab-inactive"
href="https://codesnippets.pro/pricing/" target="_blank"
aria-label="<?php esc_attr_e( 'Find more about Pro (opens in external tab)', 'code-snippets' ); ?>">
<?php echo wp_kses( __( 'Upgrade to <span class="badge pro-badge small-badge">Pro</span>', 'code-snippets' ), [ 'span' => [ 'class' => true ] ] ); ?>
<span class="dashicons dashicons-external"></span>
__( 'Function snippets are run on your site as if there were in a plugin or theme functions.php file.', 'code-snippets' ),
__( 'Learn more about function snippets →', 'code-snippets' ),
'https://codesnippets.pro/learn-php/',
__( 'Content snippets are bits of reusable PHP and HTML content that can be inserted into posts and pages.', 'code-snippets' ),
__( 'Learn more about content snippets →', 'code-snippets' ),
'https://codesnippets.pro/learn-html/',
__( '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' ),
__( 'Learn more about style snippets →', 'code-snippets' ),
'https://codesnippets.pro/learn-css/',
__( 'Script snippets are loaded on the site front-end in a JavaScript file, either in the head or body sections.', 'code-snippets' ),
__( 'Learn more about javascript snippets →', 'code-snippets' ),
'https://codesnippets.pro/learn-js/',
__( 'See all your public and private snippets that are stored in your Code Snippet Cloud codevault.', 'code-snippets' ),
__( 'Learn more about Code Snippets Cloud →', 'code-snippets' ),
'https://codesnippets.cloud/getstarted/',
if ( isset( $type_info[ $current_type ] ) ) {
$info = $type_info[ $current_type ];
'<p class="snippet-type-description">%s <a href="%s" target="_blank">%s</a></p>',
do_action( 'code_snippets/admin/manage/before_list_table' );
$this->list_table->views();
switch ( $current_type ) {
include_once 'partials/cloud-search.php';
include_once 'partials/list-table.php';
do_action( 'code_snippets/admin/manage', $current_type );