Check radio get value to array

First, let’s put all the “payvalue” radio options into an array. This will allow us to then display them all using a foreach loop to reduce redundancy and the chance to make a mistake: $payValueOptions = [126500000, 252000000, 503000000]; Now, let’s render the fields in a foreach loop: $selectedPayValue = $_GET[‘price’]; foreach ($payValueOptions as $option): … Read more

WordPress taxonomy radio buttons

However, this will turn ALL terms checkboxes to radio buttons. Not only that, it’ll turn any checkbox in a meta box – not ideal! Instead, let’s specifically target the wp_terms_checklist() function, which is used to generate the list of checkboxes across the admin (including quick edit). /** * Use radio inputs instead of checkboxes for … Read more

Change default “Apply Changes To” radio option when editing images

It is hopeless to hook into the image-edit.php ajax loaded screen. This issue, to pre-select “thumbnail only” radio option instead of “all images” can be solved by jQuery. The snippet in your functions.php can be improved, but works: // Populate thumbnail settings function entex_admin_image_editor_activate_tweaks() { ?> <script type=”text/javascript”> jQuery(document).ready(function($) { $(document).ajaxStop(function(){ if($(‘.imgedit-settings input[value=”thumbnail”]’).get(0)) { $el … Read more