display most active user sort by comment count [Solved]

you can use this $user = new wp_user(get_current_user_id()); function commentCount() { global $user; global $wpdb; $count = $wpdb->get_var(‘SELECT COUNT(comment_ID) FROM ‘ . $wpdb->comments. ‘ WHERE comment_author_email = “‘ . $user->data->user_email . ‘” and comment_approved = 1’); return $count; } echo ”; echo commentCount();

product_type_options get saved value [closed]

I have modified your code please check the below code. function add_octopus_child_option( $product_type_options ) { $product_type_options[‘childocto’] = array( ‘id’ => ‘_childocto’, ‘wrapper_class’ => ‘show_if_octopus’, ‘label’ => __( ‘Gekoppeld’, ‘woocommerce’ ), ‘description’ => __( ‘Vink dit aan indien dit niet het hoofdproduct is.’, ‘woocommerce’ ), ‘default’ => ‘no’ ); return $product_type_options; } add_filter( ‘product_type_options’, ‘add_octopus_child_option’ ); … Read more

dynamic php menu with hidden sub-categories only showing when the category name is clicked

well, I went for a different approach, in this case with radiobuttons. It is working and it is 95% the result desired. <?php $cats = array(array(‘first’, ‘sub-first’, ‘sub-sub-first’), array(‘second’, ‘sub-second’), array(‘third’, ‘sub-third’, ‘sub-sub-third’)); ?> <label>Categorias</label> <?php foreach($cats as $cat): if (isset($cat[0])): ?> <div class=”div1″> <input type=”radio” id=”<?php echo $cat[0] ?>” name=”age” value=”30″> <label for=”<?php echo … Read more

Custom global variable not working in function

I try to use this code and for the if statments I had to put a global $query_obj before the code, I do not know if is the case. global $query_obj; if ( is_a($query_obj, ‘WP_Term’) ) { $my_base_url = get_term_link($query_obj); } elseif ( is_a($query_obj, ‘WP_Post’) ) { $my_base_url = get_permalink(); } else { $my_base_url = … Read more

reset data of an array

try to comment out the last if /* if (is_array($results) && !empty($results)) { $row = $results[0]; if ($row->shared_watches >= $accountSharing[‘unique_video_watches_threshold’]) { $banReason = ‘שיתוף’; qz_user_ban($user_id, $banReason, false); //wp_send_json_error(qz_user_get_ban_message($banReason)); } } */ this if I cannot understand if is where the message is send or where the user gets ban, maybe it is the solution to … Read more