OK, so the error is no longer happening? The error regarding the unexpected ampersand I suspect is due to copying code from the support forum which may handle escaped characters unexpectedly. Compare bad/good:
https://gist.github.com/westonruter/6e0a940fa8ccff2ace08365b91a83297#file-good-php
In any case, it seems your debug log did end up sending the value. Interesting that hex is var(--base-2)
. That is definitely not expected.
That does seem like something set from the theme.
The way to handle this, it seems, is we’ll need to detect the case where a non-hex value is being passed in to the print_editor_color_palette_styles
method.
So here’s what I suggest you try. At this conditional here: https://github.com/ampproject/amp-wp/blob/a373ac8f65f26ee7df7313ff5d734b5704781ab0/src/ReaderThemeSupportFeatures.php#L284-L286
Add another one after it:
if ( ! preg_match( '/^[0-9a-f]+$/i', ltrim( $color_option[ self::KEY_COLOR ], '#' ) ) ) {
continue;
}
The method would then look like this: https://gist.github.com/westonruter/e782d795fc5e72095cdbddbc5215fdb2#file-print_editor_color_palette_styles-php-L15-L19
That should prevent the deprecation notice from occurring. If it works for you, I’ll open a PR to include it in the next release.