PluginProbe
WP Coder – Insert & Manage Code Snippets / 4.3
WP Coder – Insert & Manage Code Snippets v4.3
4.5.1 1.1 2.3.1 2.3.2 2.4.1 2.5.1 2.5.2 2.5.3 2.5.4 2.5.5 2.5.6 3.0 3.0.1 3.0.2 3.0.3 3.0.4 3.0.5 3.1 3.1.1 3.2 3.2.1 3.3 3.4 3.5 3.5.1 All 39 releases
← All changes | classes/Dashboard/DashboardInitializer.php +26 -20 3.04.3 View file →
@@ -3,9 +3,9 @@
3 3 namespace WPCoder\Dashboard;
4 4
5 5 defined( 'ABSPATH' ) || exit;
6 6
7 -use WPCoder\WOW_Plugin;
7 +use WPCoder\WPCoder;
8 8
9 9 class DashboardInitializer {
10 10
11 11 public static function init(): void {
@@ -10,10 +10,10 @@
10 10
11 11 public static function init(): void {
12 12 self::header();
13 13 echo '<div class="wrap wowp-wrap">';
14 - self::menu();
15 - self::include_pages();
14 +// self::menu();
15 +// self::include_pages();
16 16 echo '</div>';
17 17 }
18 18
19 19 public static function header(): void {
@@ -18,34 +18,39 @@
18 18
19 19 public static function header(): void {
20 20 $logo_url = self::logo_url();
21 21 $add_url = add_query_arg( [
22 - 'page' => WOW_Plugin::SLUG,
22 + 'page' => WPCoder::SLUG,
23 23 'tab' => 'settings',
24 24 'action' => 'new'
25 25 ], admin_url( 'admin.php' ) );
26 26 ?>
27 - <div class="wowp-header-wrapper">
28 - <div class="wowp-header-border"></div>
29 - <div class="wowp-header">
30 - <div class="wowp-logo">
31 - <img src="<?php echo esc_url( $logo_url ); ?>"
32 - alt="<?php echo esc_attr( WOW_Plugin::NAME ); ?> logo">
33 - </div>
34 - <h1><?php echo esc_html( WOW_Plugin::NAME ); ?> <sup
35 - class="wowp-version"><?php echo esc_html( WOW_Plugin::VERSION ); ?></sup></h1>
36 - <a href="<?php echo esc_url( $add_url ); ?>"
37 - class="button"><?php esc_html_e( 'Add New', 'wpcoder' ); ?>
38 - </a>
39 - <?php do_action( WOW_Plugin::PREFIX . '_admin_header_links' ); ?>
27 +
28 + <div class="wowp-header">
29 + <div class="wowp-header__logo">
30 + <svg width="64" height="64" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg">
31 + <path id="1728127909379-8007129Oval-Copy" fill="#2b7fff" fill-rule="evenodd" stroke="none" d="M 496 101 C 496 128.614227 473.614227 151 446 151 C 418.385773 151 396 128.614227 396 101 C 396 73.385773 418.385773 51 446 51 C 473.614227 51 496 73.385773 496 101 Z"/>
32 + <g id="window-code">
33 + <path id="Path" fill="#212121" stroke="none" d="M 245.714279 232.714294 L 74.285713 61.285736 C 60.571426 47.571411 40 47.571411 26.285713 61.285736 C 12.571427 75 12.571427 95.571442 26.285713 109.285706 L 173.714279 256.714294 L 26.285713 404.142853 C 12.571427 417.857147 12.571427 438.428589 26.285713 452.142853 C 33.142857 459 40 462.428558 50.285713 462.428558 C 60.571426 462.428558 67.428574 459 74.285713 452.142853 L 245.714279 280.714294 C 259.428589 267 259.428589 246.428558 245.714279 232.714294 Z"/>
34 + <path id="Rounded-Rectangle" fill="#212121" fill-rule="evenodd" stroke="none" d="M 256 431 C 256 448.673096 270.326874 463 288 463 L 464 463 C 481.673096 463 496 448.673096 496 431 L 496 429 C 496 411.326904 481.673096 397 464 397 L 288 397 C 270.326874 397 256 411.326904 256 429 Z"/>
35 + </g>
36 + </svg>
40 37 </div>
38 + <h1 class="wowp-header__title">
39 + <?php echo esc_html( WPCoder::info( 'name' ) ); ?>
40 + <sup class="wowp-header__title-version"><?php echo esc_html( WPCoder::info( 'version' ) ); ?></sup>
41 + </h1>
42 + <div class="wowp-header__links">
43 + <?php do_action( WPCoder::PREFIX . '_admin_header_links' ); ?>
44 + </div>
41 45 </div>
42 46
47 +
43 48 <?php
44 49 }
45 50
46 51 public static function logo_url(): string {
47 - $logo_url = WOW_Plugin::url() . 'assets/img/plugin-logo.png';
52 + $logo_url = WPCoder::url() . 'assets/img/plugin-logo.png';
48 53 if ( filter_var( $logo_url, FILTER_VALIDATE_URL ) !== false ) {
49 54 return $logo_url;
50 55 }
51 56
@@ -54,8 +59,9 @@
54 59
55 60 public static function menu(): void {
56 61
57 62 $pages = DashboardHelper::get_files( 'pages' );
63 + unset( $pages["3"], $pages["4"] );
58 64
59 65 $current_page = self::get_current_page();
60 66
61 67 $action = ( isset( $_REQUEST["action"] ) ) ? sanitize_text_field( $_REQUEST["action"] ) : '';
@@ -66,9 +72,9 @@
66 72 $id = '';
67 73
68 74 if ( $action === 'update' && $page['file'] === 'settings' ) {
69 75 $id = ( isset( $_REQUEST["id"] ) ) ? absint( $_REQUEST["id"] ) : '';
70 - $page['name'] = __( 'Update', 'wpcoder' ) . ' #' . $id;
76 + $page['name'] = __( 'Update', 'wp-coder' ) . ' #' . $id;
71 77 } elseif ( $page['file'] === 'settings' && ( $action !== 'new' && $action !== 'duplicate' ) ) {
72 78 continue;
73 79 }
74 80
@@ -90,9 +96,9 @@
90 96 $file = DashboardHelper::get_file( $current, 'pages' );
91 97
92 98
93 99 if ( $file !== false ) {
94 - $file = apply_filters( WOW_Plugin::PREFIX . '_admin_filter_file', $file, $current );
100 + $file = apply_filters( WPCoder::PREFIX . '_admin_filter_file', $file, $current );
95 101
96 102 $page_path = DashboardHelper::get_folder_path( 'pages' ) . '/' . $file;
97 103
98 104 if ( file_exists( $page_path ) ) {