juvee
Forum Replies Created
-
Hey, here is a link:
https://pasteboard.co/zj9tvefusVun.png
The issue:
We have minimum/maximum players numbers (two separate acf fields). Unfortunately, some games can have a minimum of 2 players and maximum of 2 players at the same time, which is problematic. We want to change it, so that we extract those values and create an array within a separate acf field.For example:
If we have minimum players:2 and maximum 4, we would generate an array of 2,3,4 for that game.Now, we want to use that array to display as a checkbox within Filter Everything. So the Player range would be an array of all available games, most likely 1,2,3,4,5,6, and based on that users can choose the desired amount of players.
Until this stage all is good, the issue is when selecting that certain checkbox, it then doesn’t display any results.
Hope you can either help solve this issue, or propose some other solution on how to achieve the same thing.Here is the code we are using to generate the arrays:
function generate_player_range($post_id) {
// Avoid running on ACF field save (to prevent infinite loops)
if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) return;
// Get the minimum and maximum player values (corrected field names)
$min_players = get_field('minimum_players', $post_id);
$max_players = get_field('maximum_players', $post_id);
// Check if both values are set and valid
if ($min_players && $max_players && is_numeric($min_players) && is_numeric($max_players)) {
// Create an array of player numbers between min and max (inclusive)
$player_range = range($min_players, $max_players);
// Save the array as a comma-separated string (not as an array)
update_field('player_range_array', implode(',', $player_range), $post_id);
}
}
add_action('acf/save_post', 'generate_player_range', 20); // Run after saving the post
Thanks a lot- This reply was modified 1 year, 6 months ago by juvee.
Forum: Plugins
In reply to: [Site Reviews] “No reviews” text if no ratingHey!
Any ETA? π this one feature is holding me up to release a website to the client, unsure how long it will be? (if it is even worth to wait for it or try different ways to achieve this)
ThanksForum: Plugins
In reply to: [Site Reviews] “No reviews” text if no ratinggreat, definitely a nice feature. When would the 7.2.0 launch?
Forum: Plugins
In reply to: [Site Reviews] “No reviews” text if no ratingAny ideas? :/ trying various options but can’t figure it out fully.
Thanks, done!
I am trying to write on it but it says “There has been a critical error on this website.” after submitting the question.
Yes, Type is set to auto open after 0 ms, the trigger is manual with same cookie, and the js code is changed to that popmake number. Is there some kind of video tutorial to so I can follow it to make it work? What I need:
1) Add hubspot form, after success it redirect to other page (could be even the same one, but without form displaying based on cookie.
How can I achieve the above?That I did, and added the code, but what it only changes is that the form dissapears after 5 seconds and after refresh the form still displays.
- This reply was modified 2 years, 4 months ago by juvee.
Forum: Plugins
In reply to: [qTranslate X] How to remove title "Language:" from menu?I tried this before but it seems it doesnt work, maybe I am doing something wrong, could you kindly help out with the right code?
Forum: Plugins
In reply to: [NextGEN Gallery]Doesnt enlarge the image questionanyone ?
Forum: Fixing WordPress
In reply to: Displaying same look-a-like page,but with different postsanyone?