Skip to content

Instantly share code, notes, and snippets.

@mikemcalister
Created April 8, 2019 00:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikemcalister/94607f7f633828234fc1242f177aff2b to your computer and use it in GitHub Desktop.
Save mikemcalister/94607f7f633828234fc1242f177aff2b to your computer and use it in GitHub Desktop.
wp.hooks.addFilter(
"blocks.getBlockDefaultClassName",
"atomicblocks/ab-column-block-class-name",
abCustomClassName
);
function abCustomClassName( className, name ) {
if ( 'atomic-blocks/ab-columns' === name ) {
return classnames(
className,
'ab-has-bg-' + attributes.bgType
);
}
return className;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment