Last active
August 1, 2025 09:22
-
-
Save nicmare/cf0aca4ea3af4a5c9640b271532d5cf0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // change blocksy_blocks layout | |
| add_filter("do_shortcode_tag",function($output, $tag, $attr, $m ){ | |
| if($tag != "blocksy_posts") return $output; | |
| if(!empty($attr["layout"]) && in_array($attr["layout"],["grid","enhanced-grid","simple","classic","gutenberg"])){ | |
| $p = new \WP_HTML_Tag_Processor( $output ); | |
| if ( $p->next_tag(array( 'class_name' => 'entries' )) ) { | |
| if($p->get_attribute( 'data-layout' )){ | |
| $p->set_attribute( 'data-layout', $attr["layout"] ); | |
| $output = $p->get_updated_html(); | |
| } | |
| } | |
| } | |
| return $output; | |
| },10,4); | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment