Skip to content

Commit

Permalink
wp-api: better optional chaining for vc_custom_heading shortcode
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulAdamDavis committed Jan 16, 2025
1 parent 1235858 commit ba5d5e5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/mg-wp-api/lib/processor.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,11 +273,11 @@ const processShortcodes = async ({html}) => {
});

shortcodes.add('vc_custom_heading', ({attrs}) => {
if (attrs?.font_container.includes('tag:h1')) {
if (attrs?.font_container?.includes('tag:h1')) {
return `<h1>${attrs.text}</h1>`;
} else if (attrs?.font_container.includes('tag:h2')) {
} else if (attrs?.font_container?.includes('tag:h2')) {
return `<h2>${attrs.text}</h2>`;
} else if (attrs?.font_container.includes('tag:h3')) {
} else if (attrs?.font_container?.includes('tag:h3')) {
return `<h3>${attrs.text}</h3>`;
}
});
Expand Down

0 comments on commit ba5d5e5

Please sign in to comment.