-
-
Save codysmith44/a072cdef9f87d68494bac7d900c8fe5d 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 | |
add_filter( 'generateblocks_query_loop_args', function( $query_args, $attributes ) { | |
// Add a custom class to the "grid" item. Need to double check and see if that's still the case for GB 2.0 | |
if ( ! empty( $attributes['className'] ) && strpos( $attributes['className'], 'custom-class-here' ) !== false ) { | |
$custom_args = array( | |
// list of custom arguments | |
'orderby' => 'title', | |
'order' => 'ASC' | |
); | |
return array_merge( $query_args, $custom_args ); | |
} | |
return $query_args; | |
}, 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment