Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_filter( 'bricks/element/render', function( $render, $element ) {
- // Get the element CSS classes
- $classes = ! empty( $element->attributes['_root']['class'] ) ? $element->attributes['_root']['class'] : false;
- // Check if the element has the special class "hide-for-subscribers"
- if ( $classes && in_array( 'cc--hide-gallery', $classes ) ) {
- $value = rwmb_meta( 'ig_switch' );
- if ( $value ) {
- $showgal = true ;
- } else {
- $showgal = false ;
- }
- return $showgal;
- }
- return $render;
- }, 10, 2 );
Advertisement
Add Comment
Please, Sign In to add comment