Skip to content

Commit e287699

Browse files
authored
Merge pull request #552 from xwp/release/0.1.1
Release 0.1.1
2 parents a67be3e + 8f4f714 commit e287699

File tree

9 files changed

+68
-34
lines changed

9 files changed

+68
-34
lines changed

assets/css/src/block-editor.css

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,15 @@
5656
.block-editor-block-list__block .material-design-block-handpicked-posts__selection {
5757
width: 100%;
5858
}
59+
60+
.mdc-image-list--with-text-protection .mdc-image-list__supporting {
61+
align-items: start;
62+
height: auto;
63+
max-height: 100%;
64+
min-height: 48px;
65+
padding: 8px 16px;
66+
}
67+
68+
.mdc-image-list__label {
69+
white-space: normal;
70+
}

assets/css/src/components/material.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,17 @@
127127
}
128128

129129
.mdc-image-list--with-text-protection .mdc-image-list__supporting {
130+
align-items: start;
130131
border-bottom-left-radius: var(--mdc-image-list-radius, 4px);
131132
border-bottom-right-radius: var(--mdc-image-list-radius, 4px);
133+
height: auto;
134+
max-height: 100%;
135+
min-height: 48px;
136+
padding: 8px 16px;
137+
}
138+
139+
.mdc-image-list__label {
140+
white-space: normal;
132141
}
133142

134143
.mdc-image-list__image-aspect-container .mdc-image-list__image {

material-design.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Plugin Name: Material Design
44
* Plugin URI: https://github.com/xwp/material-design-wp-plugin
55
* Description: The official Material Design plugin for WordPress. Customize your site’s navigation, colors, typography, and shapes, use Material Components, and choose from over 1,000 Google Fonts and Material Design icons. From the team behind Google’s open-source design system.
6-
* Version: 0.1.0
6+
* Version: 0.1.1
77
* Author: Material Design
88
* Author URI: http://material.io
99
* License: Apache License, Version 2.0

php/class-importer.php

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -155,27 +155,33 @@ public function import_terms() {
155155
* @return void
156156
*/
157157
public function add_menu_items() {
158-
$menu_name = esc_html__( 'Importer Primary', 'material-design' );
159-
wp_delete_nav_menu( $menu_name );
160-
161-
$menu_id = wp_create_nav_menu( $menu_name );
162-
$menu_items = $this->get_menu_items();
163-
164-
foreach ( $menu_items as $menu_item ) {
165-
$page = Helpers::get_page_by_title( $menu_item );
166-
$page_id = ! empty( $page ) ? $page->ID : null;
167-
168-
wp_update_nav_menu_item(
169-
$menu_id,
170-
0,
171-
[
172-
'menu-item-title' => $menu_item,
173-
'menu-item-status' => 'publish',
174-
'menu-item-object' => 'page',
175-
'menu-item-object-id' => $page->ID,
176-
'menu-item-type' => 'post_type',
177-
]
178-
);
158+
$menus = get_terms( 'nav_menu', [ 'hide_empty' => true ] );
159+
160+
if ( ! empty( $menus ) && ! empty( $menus[0] ) ) {
161+
$menu_id = $menus[0]->term_id;
162+
} else {
163+
$menu_name = esc_html__( 'Importer Primary', 'material-design' );
164+
wp_delete_nav_menu( $menu_name );
165+
166+
$menu_id = wp_create_nav_menu( $menu_name );
167+
$menu_items = $this->get_menu_items();
168+
169+
foreach ( $menu_items as $menu_item ) {
170+
$page = Helpers::get_page_by_title( $menu_item );
171+
$page_id = ! empty( $page ) ? $page->ID : null;
172+
173+
wp_update_nav_menu_item(
174+
$menu_id,
175+
0,
176+
[
177+
'menu-item-title' => $menu_item,
178+
'menu-item-status' => 'publish',
179+
'menu-item-object' => 'page',
180+
'menu-item-object-id' => $page->ID,
181+
'menu-item-type' => 'post_type',
182+
]
183+
);
184+
}
179185
}
180186

181187
$menu_locations = get_theme_mod( 'nav_menu_locations' );
@@ -630,16 +636,14 @@ public function update_blog_info() {
630636

631637
set_theme_mod( 'material_header_search_display', true );
632638

633-
if ( $home_page ) {
639+
if ( $home_page && empty( get_option( 'page_on_front' ) ) ) {
634640
update_option( 'page_on_front', $home_page->ID );
635641
update_option( 'show_on_front', 'page' );
636642
}
637643

638-
if ( $blog_page ) {
644+
if ( $blog_page && empty( get_option( 'page_for_posts' ) ) ) {
639645
update_option( 'page_for_posts', $blog_page->ID );
640646
}
641-
642-
set_theme_mod( 'material_header_search_display', true );
643647
}
644648

645649
/**

php/class-plugin-base.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ public function locate_plugin() {
184184
}
185185

186186
$plugin_dir = dirname( dirname( $file_name ) );
187-
$plugin_path = $this->relative_path( $plugin_dir, basename( content_url() ), \DIRECTORY_SEPARATOR );
187+
$plugin_path = $this->relative_path( $plugin_dir, basename( content_url() ), '/' );
188188

189189
$dir_url = content_url( trailingslashit( $plugin_path ) );
190190
$dir_path = $plugin_dir;

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ The official Material Design plugin for WordPress. Customize your site’s navig
77
**Contributors:** [google](https://profiles.wordpress.org/google), [materialdesign](https://profiles.wordpress.org/materialdesign), [xwp](https://profiles.wordpress.org/xwp)
88
**Requires at least:** 5.2
99
**Tested up to:** 5.6
10-
**Stable tag:** 0.1.0
10+
**Stable tag:** 0.1.1
1111
**License:** [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0)
1212

1313
[![Build Status](https://travis-ci.com/xwp/material-design-wp-plugin.svg?branch=develop)](https://travis-ci.com/xwp/material-design-wp-plugin) [![Coverage Status](https://coveralls.io/repos/xwp/material-design-wp-plugin/badge.svg?branch=develop)](https://coveralls.io/github/xwp/material-design-wp-plugin) [![Built with Grunt](https://gruntjs.com/cdn/builtwith.svg)](http://gruntjs.com)

readme.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Contributors: google, materialdesign, xwp
33
Requires at least: 5.2
44
Tested up to: 5.6
5-
Stable tag: 0.1.0
5+
Stable tag: 0.1.1
66
License: Apache License, Version 2.0
77
License URI: https://www.apache.org/licenses/LICENSE-2.0
88

tests/e2e/specs/block-editor/blocks/tab-bar/tab-bar.spec.js

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ describe( 'blocks: material/tab-bar', () => {
179179
).toHaveLength( 0 );
180180
} );
181181

182-
it( 'should not offer tab-bar as a block option within another Tabss content', async () => {
182+
it( 'should not offer tab-bar as a block option within another Tabs content', async () => {
183183
await insertBlock( 'Tabs' );
184184
await selectBlockByName( 'material/tab-bar' );
185185

@@ -191,8 +191,17 @@ describe( 'blocks: material/tab-bar', () => {
191191
const [ searchBlock ] = await page.$$( '.block-editor-inserter__search' );
192192
await searchBlock.type( 'Tabs' );
193193

194-
expect(
195-
await page.$$( '.block-editor-inserter__no-results' )
196-
).toHaveLength( 1 );
194+
try {
195+
expect(
196+
await page.$$( '.block-editor-inserter__no-results' )
197+
).toHaveLength( 1 );
198+
} catch ( ex ) {
199+
// eslint-disable-next-line jest/no-try-expect
200+
expect(
201+
await page.$$(
202+
'.block-editor-block-types-list__item editor-block-list-item-material-tab-bar'
203+
)
204+
).toHaveLength( 0 );
205+
}
197206
} );
198207
} );

tests/e2e/specs/customizer/shape-size.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ describe( 'Customize controls: Shape Size (Corner Styles)', () => {
145145

146146
let globalRadius = await moveRangeSlider( sliders[ 0 ], 0.25 );
147147
const buttonRadius = await moveRangeSlider( sliders[ 1 ], 0.5 );
148-
const dataTableRadius = await moveRangeSlider( sliders[ 4 ], 1 );
148+
const dataTableRadius = await moveRangeSlider( sliders[ 4 ], 0.95 );
149149

150150
expect(
151151
await page.evaluate( el => {

0 commit comments

Comments
 (0)