Created
October 8, 2019 15:37
-
-
Save allycspf/02d07b91c1755c5a9bd5cece0a52eb84 to your computer and use it in GitHub Desktop.
Pretty Links query debugging plugin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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