Skip to content

Commit 0cbddee

Browse files
authored
Merge pull request #208 from ResponsiveMenu/dev
Release 4.2.0
2 parents b99b982 + 2455d80 commit 0cbddee

File tree

7 files changed

+114
-19
lines changed

7 files changed

+114
-19
lines changed

readme.txt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Contributors: expresstech, responsivemenu, imvarunkmr, surajkumarsingh, infosate
33
Tags: responsive, mega menu, navigation, mobile, hamburger
44
Requires at least: 3.6
55
Tested up to: 6.0
6-
Stable tag: 4.1.12
6+
Stable tag: 4.2.0
77
Requires PHP: 5.6
88
License: GPLv2 or later
99
License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -88,8 +88,6 @@ If you like this plugin, consider exploring our other themes and plugins:
8888

8989
⚡ [InstaWP](https://instawp.io/) - Launch a quick WordPress site with this sandbox service. Create New WordPress instance within a second.
9090

91-
🔒 [Hide My WP](https://hidemywp.net/) - Hide your WordPress from bots, attackers & spammers. Hides all the known URLs, paths, plugins, themes which can reveal that you are using WP, also comes with an in-built firewall & trust network.
92-
9391
== Installation ==
9492

9593
1. Upload `responsive-menu` to the `/wp-content/plugins/` directory
@@ -120,8 +118,13 @@ To view our FAQ, please go to [https://responsive.menu/faq/](https://responsive.
120118

121119
== Changelog ==
122120

121+
= 4.2.0 (8th Sep 2022) =
122+
* Feature: Added classic menu support for block themes
123+
* Bug: Fixed conflict issues with Beaver Themer Plugin
124+
* Enhancement: Added alert popup if WordPress Menus are empty
125+
123126
= 4.1.12 (1st Aug 2022) =
124-
* Bug: Fixed conflict issues with conflict with Multiple Page Generator Plugin
127+
* Bug: Fixed conflict issues with Multiple Page Generator Plugin
125128
* Enhancement: Added timestamps as a version to generated CSS/JSS urls
126129

127130
= 4.1.11 (25th May 2022) =

responsive-menu.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Plugin Name: Responsive Menu
55
Plugin URI: https://expresstech.io
66
Description: Highly Customisable Responsive Menu Plugin for WordPress
7-
Version: 4.1.12
7+
Version: 4.2.0
88
Author: ExpressTech
99
Text Domain: responsive-menu
1010
Author URI: https://responsive.menu
@@ -16,7 +16,7 @@
1616
* Constant as plugin version.
1717
*/
1818
if ( ! defined( 'RMP_PLUGIN_VERSION' ) ) {
19-
define( 'RMP_PLUGIN_VERSION', '4.1.12' );
19+
define( 'RMP_PLUGIN_VERSION', '4.2.0' );
2020
}
2121

2222
define( 'RESPONSIVE_MENU_URL', plugin_dir_url( __FILE__ ) );

v4.0.0/assets/admin/scss/admin.css

Lines changed: 62 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2048,6 +2048,68 @@ button.menu-save {
20482048
cursor: pointer;
20492049
}
20502050

2051+
#rmp-new-menu-wizard .rmp-dialog-wrap.wp-clearfix.rmp-menu-empty {
2052+
max-width: 470px;
2053+
margin-left: auto;
2054+
margin-right: auto;
2055+
top: 200px;
2056+
}
2057+
2058+
.rmp-menu-empty h2{
2059+
font-weight: 500;
2060+
font-size: 19px;
2061+
line-height: 22px;
2062+
letter-spacing: 0.05em;
2063+
color: #000000;
2064+
margin-bottom: 10px;
2065+
}
2066+
2067+
.rmp-dark-mode .rmp-menu-empty h2{
2068+
color: #fff;
2069+
}
2070+
2071+
.rmp-menu-empty .rmp-btn-group {
2072+
margin-top: 40px;
2073+
display: flex;
2074+
flex-wrap: wrap;
2075+
}
2076+
2077+
.rmp-menu-empty p{
2078+
font-weight: 500;
2079+
font-size: 14px;
2080+
line-height: 22px;
2081+
color: #7B8795;
2082+
}
2083+
2084+
.rmp-dark-mode .rmp-menu-empty p{
2085+
color: #c8c8c8;
2086+
}
2087+
2088+
#rmp-new-menu-wizard .rmp-dialog-wrap.rmp-menu-empty .rmp-dialog-contents {
2089+
min-height: auto;
2090+
padding: 0 30px;
2091+
}
2092+
2093+
.rmp-menu-empty .rmp-btn-primary ,
2094+
.rmp-menu-empty .rmp-btn-secondary {
2095+
background: #62BCF2;
2096+
border-radius: 5px;
2097+
border: none;
2098+
font-weight: 600;
2099+
font-size: 13px;
2100+
line-height: 16px;
2101+
padding: 10px 20px;
2102+
color: #fff;
2103+
margin-bottom: 15px;
2104+
margin-right: 15px;
2105+
}
2106+
2107+
.rmp-menu-empty .rmp-btn-secondary {
2108+
background: #DBE3EB;
2109+
color: #121C24;
2110+
padding: 10px 35px;
2111+
}
2112+
20512113
#rmp-menu-save-theme-wizard .rmp-dialog-contents {
20522114
display: flex;
20532115
justify-content: center;
@@ -2060,7 +2122,6 @@ button.menu-save {
20602122
margin: 5%;
20612123
}
20622124

2063-
20642125
.rmp-save-menu-input {
20652126
display: inline-flex;
20662127
margin-top: 20px;
481 Bytes
Loading

v4.0.0/inc/classes/class-style-manager.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ protected function setup_hooks() {
6565
add_action( 'rmp_theme_apply', array( $this, 'save_style_css_on_file' ), 10, 0 );
6666
add_action( 'rmp_migrate_menu_style', array( $this, 'save_style_css_on_file' ), 10, 0 );
6767
add_action( 'rmp_import_menu', array( $this, 'save_style_css_on_file' ), 10, 0 );
68+
add_action('after_setup_theme', array( $this, 'rm_add_classic_menu_support' ) );
6869

6970
// Hide adminbar.
7071
if ( 'hide' == $this->option_manager->get_global_option( 'menu_adjust_for_wp_admin_bar' ) ) {
@@ -1530,4 +1531,13 @@ public function get_common_scss_to_css() {
15301531
return new \WP_Error( 'Warning: Common style scss compile failed <br/> <br />' . $e->getMessage() );
15311532
}
15321533
}
1534+
1535+
/**
1536+
* Adding theme support for menus
1537+
*
1538+
* @since 4.2.0
1539+
*/
1540+
public function rm_add_classic_menu_support() {
1541+
add_theme_support( 'menus' );
1542+
}
15331543
}

v4.0.0/inc/helpers/custom-functions.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ function rmp_get_list_of_pages() {
6262
foreach ( $posts as $post ) {
6363
$all_pages[ $post->ID ] = $post->post_title;
6464
}
65-
65+
wp_reset_postdata();
6666
return $all_pages;
6767
}
6868

@@ -107,7 +107,7 @@ function get_all_rmp_menu_ids() {
107107
$menu_ids[] = $menu->ID;
108108
}
109109
}
110-
110+
wp_reset_postdata();
111111
return $menu_ids;
112112
}
113113

@@ -133,7 +133,7 @@ function rmp_get_all_menus() {
133133
$menus[ $menu->ID ] = $menu->post_title;
134134
}
135135
}
136-
136+
wp_reset_postdata();
137137
return $menus;
138138
}
139139

v4.0.0/templates/new-menu-wizard.php

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,25 @@
2323
$classes = 'rmp-dark-mode';
2424
}
2525

26+
$nav_menus = wp_get_nav_menus();
2627
?>
2728
<div class="<?php echo esc_attr( $classes ); ?>">
2829
<section id="rmp-new-menu-wizard" class="rmp-dialog-overlay rmp-new-menu-wizard" style="display:none">
2930
<div class="rmp-dialog-backdrop"></div>
30-
<div class="rmp-dialog-wrap wp-clearfix">
31+
<div class="rmp-dialog-wrap wp-clearfix <?php echo empty($nav_menus) ? 'rmp-menu-empty' : ''; ?>">
3132

3233
<!-- This is new new wizard header -->
3334
<div class="rmp-dialog-header">
3435
<div class="title">
35-
<img alt="logo" width="34" height="34" src="<?php echo esc_url( RMP_PLUGIN_URL_V4 . '/assets/images/rmp-logo.png' ); ?>" />
36-
<span> <?php esc_html_e( 'Create New Menu', 'responsive-menu' ); ?> </span>
36+
<?php if ( empty( $nav_menus ) ) { ?>
37+
<img alt="logo" src="<?php echo esc_url( RMP_PLUGIN_URL_V4 . '/assets/images/rmp-warning.png' ); ?>" />
38+
<span class="rm-text-primary"> <?php esc_html_e( 'WordPress menu missing', 'responsive-menu' ); ?> </span>
39+
<?php }else { ?>
40+
<img alt="logo" width="34" height="34" src="<?php echo esc_url( RMP_PLUGIN_URL_V4 . '/assets/images/rmp-logo.png' ); ?>" />
41+
<span> <?php esc_html_e( 'Create New Menu', 'responsive-menu' ); ?> </span>
42+
<?php } ?>
3743
</div>
44+
<?php if ( ! empty( $nav_menus ) ) : ?>
3845
<nav class="rmp-new-menu-step-conatiner">
3946
<ul class="rmp-new-menu-steps">
4047
<li class="rmp-new-menu-step current">
@@ -45,22 +52,22 @@
4552
</li>
4653
</ul>
4754
</nav>
55+
<?php endif; ?>
4856
<button class="close dashicons dashicons-no"></button>
4957
</div>
5058

5159
<!-- This is menu create wizard setting sections. -->
5260
<div class="rmp-dialog-contents" >
53-
5461
<div id="select-themes" class="rmp-new-menu-themes rmp-menu-section current">
5562
<div id="tabs" class="tabs">
63+
<?php if ( ! empty( $nav_menus ) ) : ?>
5664
<!-- This is theme type list -->
5765
<ul class="nav-tab-wrapper">
5866
<li><a class="nav-tab rmp-v-divider" href="#tabs-1"><?php esc_html_e( 'Installed Themes', 'responsive-menu' ); ?></a></li>
5967
<li><a class="nav-tab rmp-v-divider <?php echo esc_attr( $rmp_browse_class ); ?>" href="#tabs-2"><?php esc_html_e( 'Marketplace', 'responsive-menu' ); ?></a></li>
6068
<li><a class="nav-tab" href="#tabs-3"><?php esc_html_e( 'Saved Templates', 'responsive-menu' ); ?></a></li>
6169
<li style="float:right;"><button id="rmp-upload-new-theme" class="button btn-import-theme"><?php esc_html_e( 'Import', 'responsive-menu' ); ?></button></li>
6270
</ul>
63-
6471
<!-- This is menu theme upload section -->
6572
<div id="rmp-menu-library-import" class="rmp-theme-upload-container hide" >
6673
<p><?php esc_html_e( 'If you have a menu theme in a .zip format, you can upload here.', 'responsive-menu' ); ?></p>
@@ -90,16 +97,31 @@
9097
?>
9198
</ul>
9299
</div>
100+
<?php endif; ?>
93101

94102
<!-- This is available theme list. -->
95103
<div id="tabs-1" class="rmp-themes">
96-
<?php $theme_manager->get_available_themes(); ?>
104+
<?php if ( ! empty( $nav_menus ) ) :
105+
$theme_manager->get_available_themes();
106+
else : ?>
107+
<div class="rmp-admin-warning-notice">
108+
<h2><?php esc_html_e( 'Looks like your WordPress website do not have any menus yet!', 'responsive-menu' ); ?></h2>
109+
<p><?php esc_html_e( 'Responsive menu plugin requires at least one WordPress menu.', 'responsive-menu' ); ?>
110+
<p><?php esc_html_e( 'Please create a new WordPress menu by using following button and try again.', 'responsive-menu' ); ?></p>
111+
<div class="rmp-btn-group">
112+
<a class="rmp-btn-primary" href="<?php echo esc_url( admin_url() . 'nav-menus.php' ); ?>"> <?php esc_html_e( 'Create WordPress Menu', 'responsive-menu' ); ?> </a>
113+
<a class="rmp-btn-secondary" rel="noopener" target="_blank" href="<?php echo esc_url( 'https://responsive.menu/knowledgebase/create-a-wordpress-menu/' ); ?>"> <?php esc_html_e( 'Read Documention', 'responsive-menu' ); ?> </a>
114+
</div>
115+
</div>
116+
<?php endif; ?>
97117
</div>
98118

119+
<?php if ( ! empty( $nav_menus ) ) : ?>
99120
<!-- This is saved template themes. -->
100121
<div id="tabs-3" class="rmp-themes">
101122
<?php $theme_manager->rmp_saves_theme_template_list(); ?>
102123
</div>
124+
<?php endif; ?>
103125
</div>
104126
</div>
105127

@@ -129,7 +151,6 @@
129151
<div class="input-control">
130152
<select name="menu-to-use" id="rmp-menu-to-use">
131153
<?php
132-
$nav_menus = wp_get_nav_menus();
133154
foreach ( $nav_menus as $nav_menu ) {
134155
?>
135156
<option value="<?php echo esc_attr( $nav_menu->slug ); ?>"><?php echo esc_html( $nav_menu->name ); ?></option>
@@ -258,7 +279,7 @@
258279

259280
</div>
260281
</div>
261-
282+
<?php if ( ! empty( $nav_menus ) ) : ?>
262283
<!-- This is menu create wizard footer. -->
263284
<div class="rmp-dialog-footer">
264285
<span class="spinner"></span>
@@ -270,7 +291,7 @@
270291
<?php esc_html_e( 'Create Menu', 'responsive-menu' ); ?>
271292
</button>
272293
</div>
273-
294+
<?php endif; ?>
274295
</div>
275296
</section>
276297
</div>

0 commit comments

Comments
 (0)