choose selected for select option with condition [closed]
You should have only 1 select. Before the “>” of each option you can add <?php echo ( $_POST[‘select1’] == ‘value’ ? ‘selected’ : ” ); ?>
You should have only 1 select. Before the “>” of each option you can add <?php echo ( $_POST[‘select1’] == ‘value’ ? ‘selected’ : ” ); ?>
You can create a custom shortcode wrapper that will execute the shortcode with the desired attributes, so you would use [jobs-custom] in the page: add_shortcode(‘jobs-custom’, ‘custom_jobs_shortcode’); function custom_jobs_shortcode($atts) { if (is_user_logged_in()) { $per_page = get_user_meta(get_current_user_id(), ‘jobs-per-page’, true); } if (!isset($per_page) || !$per_page) { if (isset($_COOKIE[‘jobs-per-page’])) {$per_page = $_COOKIE[‘jobs-per-page’];} else {$per_page = 10;} } return do_shortcode(‘[jobs … Read more
You can output the exact SQL query generated by WP_Query using $the_final_query->request This should give you the starting point you need to customize your SQL
I founded myself my searching: $sql = $wpdb->prepare( ” SELECT meta_value FROM {$wpdb->prefix}commentmeta INNER JOIN {$wpdb->prefix}comments ON {$wpdb->prefix}commentmeta.comment_id = {$wpdb->prefix}comments.comment_ID WHERE comment_post_ID = %d AND meta_key = ‘rating’ AND meta_value IS NOT NULL AND meta_value <> ” “, get_the_ID() ); $results = $wpdb->get_results( $sql );
Can you try this? (function($) { “use strict”; $(‘.select2’).select2(); $(document).on(‘woocommerce_variations_loaded’, function(event) { $(document).find(‘.select2’).select2(); }); })( jQuery ); Not tested. Thanks
Can you try this amendment and see if $field is returning as you expect? $field[‘choices’][] = $choice;
Load google font script based on optgroup label selected
This works: $WhoIsUser = get_users( array( ‘meta_key’ => ‘deviceid’, ‘meta_value’ => ‘45545’ ) ); This returns the whole row for that user from the users table. If you print_r it out like so: echo ‘<pre>’ echo print_r($WhoIsUser, TRUE); echo ‘</pre>’ you get: Array ( [0] => WP_User Object ( [data] => stdClass Object ( [ID] … Read more
Try this instead, combine all 3 functions into a single one, add_filter(‘cf7sg_dynamic_dropdown_custom_options’, ‘filter_options’,10,3); function filter_options($options, $field_name, $form_key){ //field ‘dynamic_select-461’ if($form_key == ‘bez-nazvu’ && $field_name == ‘dynamic_select-461’) { $options = array(); //get your terms $terms = get_the_terms( $post->ID , ‘strava’ ); if( ! empty( $terms ) && ! is_wp_error( $term_args ) ) { foreach( $terms as … Read more
This may be a terrible way to go about population of a CF7 field… However, the way I have done so in the past is to use an identifier as the default value of the field you want to populate, for example {{cf7_year}}. I would then use a mixture of PHP to query and get … Read more