The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [request-filter]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
14 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 ...
0
votes
1answer
34 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' ); ...
0
votes
1answer
382 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 ...
0
votes
1answer
56 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 ...
2
votes
1answer
448 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 ...
0
votes
1answer
50 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 ...
0
votes
0answers
242 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 ...
1
vote
1answer
67 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 =...
0
votes
1answer
669 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 ...
1
vote
1answer
336 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-...
0
votes
1answer
606 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 ...
0
votes
1answer
695 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 ...
2
votes
2answers
2k 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 ...
8
votes
1answer
5k 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 ...
1
vote
1answer
102 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 ...
4
votes
1answer
206 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). ...
0
votes
0answers
47 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 ...
0
votes
2answers
199 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 ...
0
votes
1answer
586 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 ...
3
votes
1answer
479 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 ...
0
votes
2answers
109 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 ...
3
votes
1answer
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 ...
2
votes
1answer
536 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 (...
1
vote
1answer
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( '...
4
votes
1answer
694 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 ...
0
votes
1answer
590 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 ...