Skip to content

Commit

Permalink
Add support for pmc-term-content (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
ethitter authored May 14, 2024
1 parent a852278 commit ff071d8
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 1 deletion.
1 change: 1 addition & 0 deletions classes/class-init.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ private function _get_query_args_instances(): array {
// new Query_Args\PMC_Publication_Issue(),
new Query_Args\PMC_Reviews(),
new Query_Args\PMC_Store_Products(),
new Query_Args\PMC_Term_Content(),
new Query_Args\PMC_TOC(),
new Query_Args\PMC_Top_Video(),
new Query_Args\PMC_Touts(),
Expand Down
3 changes: 2 additions & 1 deletion classes/query-args/class-pmc-options.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ final class PMC_Options extends Query_Args {
*/
public static function get_query_args(): array {
return [
'post_type' => Plugin::POST_TYPE_NAME,
'post_type' => Plugin::POST_TYPE_NAME,
'posts_per_page' => -1,
];
}
}
46 changes: 46 additions & 0 deletions classes/query-args/class-pmc-term-content.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?php
/**
* Retain post objects that use the PMC Term Content plugin.
*
* @package pmc-wp-local-data-cli
*/

declare( strict_types = 1 );

namespace PMC\WP_Local_Data_CLI\Query_Args;

use PMC\Term_Content\Plugin;
use PMC\WP_Local_Data_CLI\Query_Args;

/**
* Class PMC_Term_Content.
*/
final class PMC_Term_Content extends Query_Args {
/**
* Skip processing backfill, deferring to post-type-specific handling.
*
* @var bool
*/
public static bool $find_linked_ids = false;

/**
* Whether or not to skip the backfill process. Typically this is used when
* a query's `post_type` is set to the special value "any" as backfill
* cannot be applied to such a query.
*
* @var bool
*/
public static bool $skip_backfill = true;

/**
* Build array of `WP_Query` arguments used to retrieve IDs to retain.
*
* @return array
*/
public static function get_query_args(): array {
return [
'post_type' => Plugin::get_instance()->get_post_type_slugs(),
'posts_per_page' => -1,
];
}
}

0 comments on commit ff071d8

Please sign in to comment.