• Resolved teracomp

    (@teracomp)


    Is there a simple way to unwire the jQuery Chosen feature and have Categories listed just like job types?

    The following code creates the desired output (mostly), but is not recognized as part of the filter.

    <ul class="job_types">
         <?php $job_categories = get_job_listing_categories(); ?>
            <?php foreach ( job_categories as $cat ) : ?>
                <li><label for="job_category_<?php echo $cat->slug; ?>"
                      class="<?php echo sanitize_title( $cat->name ); ?>">
                      <input type="checkbox" name="search_categories[<?php echo $cat->term_id; ?>]" value="<?php echo $cat->slug; ?>"
                    <?php checked( in_array( $cat->slug, $job_categories ), true ); ?>
                    id="job_category_<?php echo $cat->slug; ?>" /> <?php echo $cat->name; ?></label></li>
    		<?php endforeach; ?>
    	</ul>
    	<input type="hidden" name="search_categories[]" value="" />

    Selecting a checkbox has no affect on the filter.

    btw, I know the checked() code is wrong…needs to look in $search_categories[], but this array is not being built, so it just throws an error.

    As usual, greatly appreciate your advice and direction.

    https://www.ads-software.com/plugins/wp-job-manager/

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Unwire jQuery Chosen, Create Checkboxes for Categories’ is closed to new replies.