Questions tagged [request-filter]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
104 views

Custom endpoint filtering post by custom taxonomies

I am trying to create a custom endpoint by custom taxonomies, I have already created another for the categories and it works well, however there is something I cannot solve with this function ...
user avatar
0 votes
0 answers
93 views

Can someone explain what's the use of parse request function in WordPress?

What's the meaning of "Parses the request to find the correct WordPress query" in plain Englush? Reference: https://developer.wordpress.org/reference/classes/wp/parse_request/ I encountered ...
user avatar
0 votes
1 answer
128 views

How to query 2 custom post types that need to share a slug?

I'm trying to make 2 custom post types (authors and works) share the same slug. The authors CPT uses an archive page which functions properly, but works CPT does not need one. CPT 1: https://domain....
user avatar
0 votes
0 answers
26 views

WordPress 5.4 and higher: Filter posts by category 1 AND category 2 in API requests

We have a WordPress 5.4 instance that we query through it's API. I am hoping to find a solution for the following problem that works with newer versions as well. What I need is an intersection when ...
user avatar
  • 103
0 votes
0 answers
113 views

Customizing the wp_video_shortcode output with add_filter

I am trying to add onmouseover="this.play()" onmouseout="this.pause()" to the default <video element in Wordpress. I am using Gutenberg block editor. By default, this is what ...
user avatar
2 votes
0 answers
40 views

Hook all http requests

How do I hook all http requests in wordpress? More specifically I am interested in examining an http header in the request and then potentially modifying headers in the request so that other plugins ...
user avatar
  • 141
0 votes
1 answer
50 views

How to create filter's for custom taxonomy page

what i want to do it's create filters for my custom taxonomy page. For example. I allready have a custom taxonomy created with thumbnails and pagination ready, but i want to add filter's for the girls....
user avatar
-1 votes
1 answer
29 views

What is the first action or filter executed by wordpress?

To mesure performance of a wordpress website i need what is the first filter or action executed by wordpress ? it seems that index.php is the input file of server, there is a way to add a global time ...
user avatar
  • 113
0 votes
0 answers
22 views

Right filter for rewriting page statuscode

I am new to developing wordpress plugins. But I am looking to write a fairly simple plugin. I want to write a plugin that rewrites the returned status code based on some logic that consults a ...
user avatar
  • 101
0 votes
1 answer
225 views

Intercept page request and add value to it

I am trying to intercept the GET request of a post and add a value to it. function foo($request) { $request['vid'] = wp_generate_uuid4(); return $request; } add_filter( 'request', 'foo' ); ...
user avatar
0 votes
1 answer
4k views

Block a specific url request

I probably have a plugin that makes a request to an URL slowly down my website. At the moment I'm still debugging the issue but, in the meantime, is there a way to prevent Wordpress to request this ...
user avatar
  • 137
0 votes
2 answers
536 views

How to trim white space in search terms?

I'm seeing a weird problem where if someone searches "Test Search" it's returning fine, but if someone searches "Test Search " it's returning some weird posts that don't seem relevant. How do I go ...
user avatar
  • 311
2 votes
1 answer
2k views

Is it possible to filter the wp_footer() scripts, read the content, and insert them inline?

I need to intercept the scripts that are added in the footer and head through the wp_footer() and wp_head() functions, something like add_filter('wp_footer', my_function) and then in my_function, I ...
user avatar
1 vote
1 answer
162 views

action is not called after a php request

I want to send a download link to user by mailchimp, after they filled out a email form. The PHP Request listener is calling my_function(), but inside this function the action is not called. The ...
user avatar
0 votes
0 answers
550 views

ACF Taxonomy search on backend (Relationship field)

I'm working on a project where I have to filter every Products:product_cat type of taxonomies on ACF. I need those product post type values which contains these taxonomy on the search field. Sadly ACF ...
user avatar
  • 19
1 vote
1 answer
75 views

WordPress request fiter order by related post's post_title

I have created two WordPresss custom post types (school, person). Each person is related to a school and the related school's post ID is stored in wp_postmeta under the person's post ID with meta_key =...
user avatar
  • 131
1 vote
1 answer
2k views

Front-end only $_POST and $_POST requests handling in WordPress plugin

I just created a WordPress plugin with a custom template that handles a $_GET request before the HTML code. Wordpress team is asking me to put this code inside a function. I understand that for admin ...
user avatar
1 vote
1 answer
1k views

How get child posts in custom post type by ajax?

I get posts and filter ayahs by tags. I get all the posts. This works well. But when I get to the parent page of the post, I need to get only child posts and filter them. I use 'post_parent' => $ post-...
user avatar
0 votes
1 answer
1k views

Custom query filter by ACF date custom field

I'm using a custom query to filter posts by date range, i read the documentation and i searched for many examples, but this code seems right to me and i don't know why it is not working ! please help ...
user avatar
  • 71
0 votes
1 answer
2k views

How to create frontend Post filter using meta query

I have created a post filter like the image below, but I have an issue with selecting multiple values from different fields. All the fields in the filter are custom fields. The thing is, in the admin ...
user avatar
2 votes
2 answers
4k views

Handling form request from plugin file

In a plugin I have a payment form that needs to be submitted (via the action= attribute) to a .php file, also located in my plugin directly. After some research, it seems like the "wordpress way" to ...
user avatar
  • 1,081
9 votes
1 answer
10k views

How to modify posts_where filter only for the search query

I'm using posts_where filter in order to modify the user searches on a web, but i find out that some default widgets like the "more recent posts" uses this filter too and their behaviour are also ...
user avatar
  • 93
1 vote
1 answer
243 views

WordPress (admin) posts search GET request filter

I wrote up a plugin that adds a column to the posts, page table (list) in the WordPress Admin panel. Each row has additional input fields (checkboxes) - allow_comments, allow_pings. These checkboxes ...
user avatar
  • 205
4 votes
1 answer
373 views

How can I control the comment counts filtering my CPT replies?

I'm developing a plugin that is using the comments table with custom comment_type for CPT replies. The problem was that, I's getting replies to my CPT in Comments page (/wp-admin/edit-comments.php). ...
user avatar
0 votes
0 answers
52 views

Search and replace post URL's on page output?

Currently, I'm using pretty permalinks for SEO purposes like this: http://example.com/sample-post. This is great for search engine ranking, but now I am finding this is not so great for mobile app ...
user avatar
  • 113
0 votes
2 answers
309 views

Test for post type in request filter?

I'm running into a catch-22 situation running a request filter. I need the request to be correct in order to run the correct filter, but I need the filter to correct the request. GAH! Here is the ...
user avatar
  • 337
0 votes
1 answer
1k views

How can i see/log all requests coming from a registration form (not from the UI)?

I am talking about the REGISTER form PROBLEM: I have some requests that are coming from somewhere else - not from the user interface. I know this, because these requests don't have all the mandatory ...
user avatar
3 votes
1 answer
717 views

Post Admin - Filter by posts without tags

I am stuck on this one and it's probably a really simple answer but can anyone please shine some light on how to add a filter menu with an option value of 'No Tags' that when clicking the Filter ...
user avatar
0 votes
2 answers
116 views

Custom search by several options send on form not works

I am using the Advanced Custom Field Plugin to add custom fields for the users profiles and display a list of users in the frontend of site with Simple User Listing Plugin. I need to filter a list of ...
user avatar
  • 33
3 votes
1 answer
2k views

Modify custom Users Manage page

I'm trying to create a submenu page under 'Users' which is like the 'All Users' page but for listing users of specific roles only. Let's just call this submenu page 'Customer'. So far I managed to ...
user avatar
  • 1,415
2 votes
1 answer
577 views

Using database meta_values to calculate new post order using pre_get_posts or a 'request' hook

UPDATE: I have worked out my implementation of the selected answer at the bottom of this post. I'm implementing a sorting algorithm based on Reddit's hotness algorithm, in addition to a time-decay (...
user avatar
  • 1,052
1 vote
1 answer
2k views

How to query a custom post type with a taxonomy filter but display post type archive page?

I'm filtering the main query of Jigoshop with my own taxonomy with this hook (The file responsible for Jigoshop queries that I'm hooking, Jigoshop hooks onto WP 'request' filter): add_filter( '...
user avatar
4 votes
1 answer
949 views

Enforcing canonical URLs with multiple custom post types

I'm working on a project with several custom post types, where one of the post types is naturally (but not actually in the WordPress sense) the 'parent' of the others. For example, say I have a ...
user avatar
0 votes
1 answer
810 views

Safe to throw 404 error in request filter?

I am working on a plug-in for my personal site and I would like it have a certain permalink structure (/projects/project-type/sub-type/project). To achieve this, I am using the request filter. Inside ...
user avatar
  • 1,405