Articles of request filter

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 it’s making me crasy 🙁 function my_pre_get_posts( $query ) { // do not modify queries […]

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 are used to update comment_status and ping_status with tick on checkbox via AJAX call. Problem begins when I have big load of posts […]

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-> ID in the request, but this does not work in the function. […]

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 = ‘person-school-id’ and meta_value = the related school’s post ID. I have added a person-type (Student, Teacher, etc. ) and the […]

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( ‘loop_shop_tax_query’, ‘my_loop_shop_tax_query’, 11 ); function loop_shop_tax_query( $request ) { $region = ‘dublin’; if ( ! empty( $region ) ) { $request[] = array( ‘taxonomy’ => […]

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 call up individual plugin files is to actually use custom queries on index.php instead. I’ve done so with […]

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 (like Hacker News hotness algorithm). The code I am currently satisfied with is a result of trial and errors in some Excel sheets […]

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 button will only show posts that have no tags associated with them? Many thanks in advance!

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 create one with its own columns, but there are still some things that I haven’t managed to modify to […]

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 custom post type called ‘book’ and another one called ‘character’, and say I want to have the following custom […]