WP Parsely status limitation
-
We ran into an issue with Parsely not showing up on posts with statuses other than publish. Kind of a weird situation, but we are making some custom statuses that are publicly available in order to accommodate an editorial workflow. Tracked the problem down to line 724 of wp-parsely.php:
if ( in_array( get_post_type(), $parsely_options['track_post_types'], true ) && 'publish' === $post->post_status ) {
I fixed this by adding a filter on the posts statuses:
$open_statuses = apply_filters('wp_parsely_open_statuses', array('publish'));
And then adjusting the conditional to allow for custom statuses:
if ( in_array( get_post_type(), $parsely_options['track_post_types'], true ) && in_array($post->post_status, $open_statuses) ) {
Of course, altering a plugin’s code is not something I’m in the habit of doing, but I in this case it was necessary. I was hoping that this simple adjustment might make its way into the next release.
- The topic ‘WP Parsely status limitation’ is closed to new replies.