Álvaro Franz
  • Member for 3 years, 1 month
  • Last seen this week
  • Sevilla, España
Does WordPress sanitize arguments to WP_Query?
Accepted answer
6 votes

It's actually a good question. Of course user input cannot be trusted, but also sanitizing the same value twice "just in case" isn't the best solution for a problem. The only real answer to ...

View answer
Get user meta for only the keys with a certain prefix
Accepted answer
2 votes

There is no native WordPress function to achieve this but you can get all meta keys for a given user ID and then filter the ones you need. Here is how to do that for a given $user_id. First you get ...

View answer
Are there any forks of WordPress (and what is different about them)?
1 votes

There is a quite stable and good-looking fork floating around called ClassicPress. The people behind ClassicPress want to go back to the roots and are putting a big focus on making decisions as ...

View answer
WP Query Meta Value - How To Identify Specific, Unique Values?
Accepted answer
1 votes

You are Storing multiple values into one single meta entry, instead of storing each value on its own meta entry (which would be the optimal approach). But still you can make it work that way. ...

View answer
Wordpress Show Parent Category Description for Sub-categories
1 votes

Approach number one If you are hard-coding a theme and you are writing your own category.php template, the first thing you have to do is to know what category you are displaying. You can use ...

View answer
Ajax Call 400 Bad Request error with POST request but not with GET request
Accepted answer
1 votes

Well this is very probably going to help someone else sometime so here it goes: Not setting the request to application/x-www-form-urlencoded makes the POST body behave like a string. So PHP does not ...

View answer
Custom Post Type - Support "author" only for admins
Accepted answer
1 votes

Thanks to TomJNowell's help, this would be a possible working solution: $supports = array( 'title', 'editor' ); if(current_user_can('delete_plugins')){ $supports[] = 'author'; } ...

View answer
Disable Wordpress Big Image Size Scaling
Accepted answer
1 votes

Now it is working as expected (disabled scaling), under the following settings: In my theme functions.php add_filter( 'big_image_size_threshold', '__return_false' ); In the WP Media Settings:

View answer
Counting instances of words in the results of a post query
Accepted answer
0 votes

What I understand from your question is that you want to: Count how many times the words inside a certain user meta field are repeated accross all the meta results for a query. One way to achieve this ...

View answer
Search filter between promo and exact price
Accepted answer
0 votes

In order to use two or more different meta fields that need to have a relationship bewteen them, you have to provide a value for the relation key. This way you can establish the relationship that must ...

View answer
Restricting displayed posts to posts from only select authors
Accepted answer
0 votes

Yes, you can use the pre_get_posts hook. From the docs: Fires after the query variable object is created, but before the actual query is run. In other words, this hook allows you to alter the WP ...

View answer