BlockTemplatesController: Check that $attributes['theme'] value isset before operating on it (https://github.com/woocommerce/woocommerce-blocks/pull/10879)
This commit is contained in:
parent
c28319fc3c
commit
fd83e0a4cb
|
@ -158,7 +158,7 @@ class BlockTemplatesController {
|
||||||
* @return string The render.
|
* @return string The render.
|
||||||
*/
|
*/
|
||||||
public function render_woocommerce_template_part( $attributes ) {
|
public function render_woocommerce_template_part( $attributes ) {
|
||||||
if ( 'woocommerce/woocommerce' === $attributes['theme'] ) {
|
if ( isset( $attributes['theme'] ) && 'woocommerce/woocommerce' === $attributes['theme'] ) {
|
||||||
$template_part = BlockTemplateUtils::get_block_template( $attributes['theme'] . '//' . $attributes['slug'], 'wp_template_part' );
|
$template_part = BlockTemplateUtils::get_block_template( $attributes['theme'] . '//' . $attributes['slug'], 'wp_template_part' );
|
||||||
|
|
||||||
if ( $template_part && ! empty( $template_part->content ) ) {
|
if ( $template_part && ! empty( $template_part->content ) ) {
|
||||||
|
|
Loading…
Reference in New Issue