Title: LegacyTemplate function add_alignment_class_to_wrapper error
Last modified: April 7, 2022

---

# LegacyTemplate function add_alignment_class_to_wrapper error

 *  Resolved [Redmatters BV](https://wordpress.org/support/users/redmatters/)
 * (@redmatters)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/legacytemplate-function-add_alignment_class_to_wrapper-error/)
 * We get the following error when updated WooCommerce to version 6.3.1
 *     ```
       PHP Fatal error:  Uncaught TypeError: Argument 1 passed to Automattic\WooCommerce\Blocks\BlockTypes\LegacyTemplate::add_alignment_class_to_wrapper() must be of the type string, null given, called in /wp-includes/class-wp-hook.php on line 309 and defined in /wp-content/plugins/woocommerce/packages/woocommerce-blocks/src/BlockTypes/LegacyTemplate.php:215
       Stack trace:
       #0 /wp-includes/class-wp-hook.php(309): Automattic\WooCommerce\Blocks\BlockTypes\LegacyTemplate->add_alignment_class_to_wrapper(NULL, Array)
       #1 /Users/renetuin/Documents/repos/redpress-v2/wp-includes/plugin.php(189): WP_Hook->apply_filters(NULL, Array)
       #2 /wp-includes/class-wp-block.php(284): apply_filters('render_block', '\n\n', Array, Object(WP_Block))
       #3 /wp-includes/blocks.php(883): WP_Block->render()
       #4 /wp- in /wp-content/plugins/woocommerce/packages/woocommerce-blocks/src/BlockTypes/LegacyTemplate.php on line 215
       ```
   
    -  This topic was modified 4 years, 2 months ago by [Redmatters BV](https://wordpress.org/support/users/redmatters/).
    -  This topic was modified 4 years, 2 months ago by [Redmatters BV](https://wordpress.org/support/users/redmatters/).
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Flegacytemplate-function-add_alignment_class_to_wrapper-error%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 5 replies - 1 through 5 (of 5 total)

 *  [Mirko P.](https://wordpress.org/support/users/rainfallnixfig/)
 * (@rainfallnixfig)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/legacytemplate-function-add_alignment_class_to_wrapper-error/#post-15538160)
 * Hi [@redmatters](https://wordpress.org/support/users/redmatters/),
 * It is likely that your theme or one of your other plugins is conflicting with
   the updated version of WooCommerce.
 * I would recommend that you perform a full conflict test to see if you can find
   the cause.
 * Here’s a more detailed explanation on how to do a conflict test:
 * [https://docs.woocommerce.com/document/how-to-test-for-conflicts/](https://docs.woocommerce.com/document/how-to-test-for-conflicts/)
 * Let us know how it goes.
 *  Thread Starter [Redmatters BV](https://wordpress.org/support/users/redmatters/)
 * (@redmatters)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/legacytemplate-function-add_alignment_class_to_wrapper-error/#post-15539062)
 * It’s indeed something in my theme, because default theme is working correctly.
   
   But error messages is referring to a function I’m not familiar of that its used
   in my theme.
 *  [Mirko P.](https://wordpress.org/support/users/rainfallnixfig/)
 * (@rainfallnixfig)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/legacytemplate-function-add_alignment_class_to_wrapper-error/#post-15540581)
 * Hi [@redmatters](https://wordpress.org/support/users/redmatters/),
 * Thank you for letting us know that is correctly working with a default theme.
 * I’d suggest making sure that your theme is up to date. If that doesn’t resolve
   the issue, we recommend reaching out to the theme developer directly. They should
   be able to assist further.
 * Best regards.
 *  Thread Starter [Redmatters BV](https://wordpress.org/support/users/redmatters/)
 * (@redmatters)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/legacytemplate-function-add_alignment_class_to_wrapper-error/#post-15903224)
 * [@rainfallnixfig](https://wordpress.org/support/users/rainfallnixfig/) problem
   is still in WooCommerce, after some more testing problem is indeed in ClassicTemplate.
   php where the parameter $content can receive a NULL value. But because of fact
   you have a cast check of string added the error is accuring.
 * When I remove string casting it works fine.
 *  [Margaret S. woo-hc](https://wordpress.org/support/users/margaretwporg/)
 * (@margaretwporg)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/legacytemplate-function-add_alignment_class_to_wrapper-error/#post-15904248)
 * Hi [@redmatters](https://wordpress.org/support/users/redmatters/)
 * Thanks for detecting that.
 * If you believe this is a bug, then a good move would be to report this to the
   developers. You can do that here: [https://github.com/woocommerce/woocommerce/issues](https://github.com/woocommerce/woocommerce/issues)

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘LegacyTemplate function add_alignment_class_to_wrapper error’ is closed
to new replies.

 * ![](https://ps.w.org/woocommerce/assets/icon.svg?rev=3234504)
 * [WooCommerce](https://wordpress.org/plugins/woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce/reviews/)

 * 5 replies
 * 3 participants
 * Last reply from: [Margaret S. woo-hc](https://wordpress.org/support/users/margaretwporg/)
 * Last activity: [3 years, 10 months ago](https://wordpress.org/support/topic/legacytemplate-function-add_alignment_class_to_wrapper-error/#post-15904248)
 * Status: resolved