<script>
jQuery(document).ready(function( $ ) {
// Function to set and lock the value
function setAndLockSelectize() {
var selectize = $('#bp-blog-category-select')[0].selectize;
// Clear any previous selections
selectize.clear();
// Add and select the value '81'
selectize.addOption({value: '81', text: 'Member Blog'});
selectize.addItem('81');
// Lock the selectize control to prevent user interaction
selectize.lock();
}
// Check if Selectize is initialized
if ($('#bp-blog-category-select').hasClass('selectized')) {
setAndLockSelectize();
} else {
// Wait for Selectize to initialize
$('#bp-blog-category-select').one('selectize:initialize', function() {
setAndLockSelectize();
});
}
});
</script>
Comments
0 B
|0 👍
/0 👎
0 B
|👍
/👎