Skip to content

Instantly share code, notes, and snippets.

@allycspf
Created October 8, 2019 15:37
Show Gist options
  • Save allycspf/02d07b91c1755c5a9bd5cece0a52eb84 to your computer and use it in GitHub Desktop.
Save allycspf/02d07b91c1755c5a9bd5cece0a52eb84 to your computer and use it in GitHub Desktop.
Pretty Links query debugging plugin
<?php
/*
* Plugin Name: Pretty Links Debugging
* Description: Debugging plugin for Pretty Links.
*/
add_filter('posts_results', function ($posts, $query) {
if (is_admin() && class_exists('PrliUtils') && isset($query->query['post_type']) && $query->query['post_type'] == 'pretty-link') {
ob_start();
var_dump($query);
PrliUtils::debug_log(ob_get_clean());
}
return $posts;
}, 10, 2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment