From f500e3cee22c0118d0d1d9a8c3c0c4c834591fda Mon Sep 17 00:00:00 2001 From: Soare Robert Daniel Date: Tue, 28 Jan 2025 11:50:04 +0200 Subject: [PATCH] feat: new Custom Layout UI/UX (#4356) --- inc/admin/dashboard/main.php | 268 +++++++++++++++++++++++++++-- inc/admin/hooks_upsells.php | 315 +++++++++++++++++++++++++++++++++++ 2 files changed, 572 insertions(+), 11 deletions(-) diff --git a/inc/admin/dashboard/main.php b/inc/admin/dashboard/main.php index 1fadc010c4..8db2be89a8 100755 --- a/inc/admin/dashboard/main.php +++ b/inc/admin/dashboard/main.php @@ -57,6 +57,8 @@ public function init() { add_action( 'admin_enqueue_scripts', [ $this, 'enqueue' ] ); add_action( 'init', array( $this, 'register_settings' ) ); add_action( 'init', array( $this, 'register_about_page' ), 1 ); + + add_action( 'admin_notices', array( $this, 'render_custom_layout_header' ) ); } /** @@ -196,18 +198,9 @@ public function register() { [ $this, 'render' ] ); - $this->copy_customizer_page( $theme_page ); + do_action( 'neve_register_submenu_page', $theme_page, $capability ); - if ( ! defined( 'NEVE_PRO_VERSION' ) || 'valid' !== apply_filters( 'product_neve_license_status', false ) ) { - // Add Custom Layout submenu for upsell. - add_submenu_page( // phpcs:ignore WPThemeReview.PluginTerritory.NoAddAdminPages.add_menu_pages_add_submenu_page - $theme_page, - __( 'Custom Layouts', 'neve' ), - __( 'Custom Layouts', 'neve' ), - $capability, - 'admin.php?page=neve-welcome#custom-layouts' - ); - } + $this->copy_customizer_page( $theme_page ); } /** @@ -823,4 +816,257 @@ private function get_external_plugins_data() { return $plugins; } + /** + * Renders the custom layout header section in the admin dashboard for Custom Layouts + * + * @access public + * @return void + */ + public function render_custom_layout_header() { + $screen = get_current_screen(); + + if ( ! $screen || ! ( $screen->id === 'edit-neve_custom_layouts' || $screen->id === 'neve_page_neve-custom-layout-upsell' ) ) { + return; + } + + $this->render_neve_header(); + + ?> + + +
+
+

+
+ + + + + + + +
+
+

+ +

+
+ + + 'neve-welcome', + ), + admin_url( 'admin.php' ) + ); + $neve_dashboard_changelog_url = $neve_dashboard_url . '#changelog'; + + ?> + + +
+
+ + + <?php esc_attr_e( 'Neve Logo', 'neve' ); ?> + + + + + + +
+ + +
+ + + +
+
+
+ +

+
+ +

+ +

+ +
+
+ +
+

+

+
+
+
+ +
+

+

+
+
+
+ +
+

+

+
+
+
+ +
+

+

+
+
+
+ + + +
+ + + — + +
+
+
+ + render_custom_layouts_upsell_modal(); ?> +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+

+ +

+
+ +
+
+
+