Title: Adding hooks for developers
Last modified: August 31, 2016

---

# Adding hooks for developers

 *  Resolved [schlimpf](https://wordpress.org/support/users/schlimpf/)
 * (@schlimpf)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/adding-hooks-for-developers/)
 * Hi dcooney,
 * I noticed that there are effectly no hooks that can be used by developers.
 * For my case, I need a hook to the alm_query_posts function.
    I need to dynamically
   exclude certain post IDs and therefore cannot use the options provided by the
   shortcode.
 * Therefore, I would need a hook to the function where you query the news posts.
 * I used the following as workaround:
 *     ```
       function wp_ajax_override_excluded_post_ids() {
       	// get newest featured
       	$args = array(
       		'post_type' => 'post',
       		'meta_key' => 'is_featured',
       		'meta_value' => '1',
       		'posts_per_page' => 1,
       	);
   
       	$posts = get_posts( $args );
   
       	if( empty( $posts ) )
       		return;
   
       	// get first post
       	$post = $posts[0];
   
       	$post_ID = $post->ID;
   
       	$_GET['post__not_in'] = $post_ID;
       }
       add_action( 'wp_ajax_alm_query_posts', 'wp_ajax_override_excluded_post_ids', -100 );
       ```
   
 * This solution is in my optinion not optimal, because first it relies on the fact
   that you dont change the ajax action call, second the indexes on the $_GET are
   not changed by you and third you dont change your action’s priority.
 * Therefore, I would love to have filters to override certain variables and maybe
   additionally have a hook to change the complete ajax query (i.e. return a custom
   array result).
 * I think these changes are only marginal for you and they do not prevent anyone
   buying your premium plugins.
    In fact, I plan to buy the complete package in 
   the near future as soon as I have the OK from my customer.
 * I think your plugin is great and this would make it even greater for developers.
 * Best
    M
 * [https://wordpress.org/plugins/ajax-load-more/](https://wordpress.org/plugins/ajax-load-more/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Darren Cooney](https://wordpress.org/support/users/dcooney/)
 * (@dcooney)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/adding-hooks-for-developers/#post-6999051)
 * Have you looked at the docs/filter-hooks portion of the Ajax Load More website?
 *  Thread Starter [schlimpf](https://wordpress.org/support/users/schlimpf/)
 * (@schlimpf)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/adding-hooks-for-developers/#post-6999055)
 * Shame on me, I didnt find that filter. Will mark it as resolved!
 *  Plugin Author [Darren Cooney](https://wordpress.org/support/users/dcooney/)
 * (@dcooney)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/adding-hooks-for-developers/#post-6999070)
 * No worries!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Adding hooks for developers’ is closed to new replies.

 * ![](https://ps.w.org/ajax-load-more/assets/icon-256x256.png?rev=2944639)
 * [Ajax Load More – Infinite Scroll, Load More, & Lazy Load](https://wordpress.org/plugins/ajax-load-more/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ajax-load-more/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ajax-load-more/)
 * [Active Topics](https://wordpress.org/support/plugin/ajax-load-more/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ajax-load-more/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ajax-load-more/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Darren Cooney](https://wordpress.org/support/users/dcooney/)
 * Last activity: [10 years, 4 months ago](https://wordpress.org/support/topic/adding-hooks-for-developers/#post-6999070)
 * Status: resolved