Last active
October 13, 2024 06:51
-
-
Save emre-edu-tech/c8f9e30c0f806d5e129572c19ece5538 to your computer and use it in GitHub Desktop.
Various code snippets for Crocoblock Plugins
This file contains 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 | |
// Crocoblock Code Snippets | |
// Jet Smart Filters | |
// ----------------- | |
// Snippet No: 1 | |
// This code below sorts an array of filters that are related to a Custom Post Type | |
// Because Custom Post Type values are not coming in alphabetical order, this code is needed | |
// 601 is the Id of Jet Smart Filter Type | |
function theme_name_jet_filter_options( $options, $filter_id, $filter ){ | |
if($filter_id == 601){ | |
asort($options); | |
} | |
return $options; | |
} | |
add_filter('jet-smart-filters/filters/filter-options', 'theme_name_jet_filter_options',10,3); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment