Skip to content

Commit

Permalink
Merge pull request #3135 from 10up/chore/update-ignored-post-types
Browse files Browse the repository at this point in the history
Update the list of post types ignored by Protected Content
  • Loading branch information
felipeelia authored Nov 16, 2022
2 parents 29793b7 + f90e837 commit 1e5c7a6
Showing 1 changed file with 19 additions and 26 deletions.
45 changes: 19 additions & 26 deletions includes/classes/Feature/ProtectedContent/ProtectedContent.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,33 +81,26 @@ public function post_types( $post_types ) {
// Let's get non public post types first
$pc_post_types = get_post_types( array( 'public' => false ) );

// We don't want to deal with nav menus
if ( $pc_post_types['nav_menu_item'] ) {
unset( $pc_post_types['nav_menu_item'] );
}

if ( ! empty( $pc_post_types['revision'] ) ) {
unset( $pc_post_types['revision'] );
}

if ( ! empty( $pc_post_types['custom_css'] ) ) {
unset( $pc_post_types['custom_css'] );
}

if ( ! empty( $pc_post_types['customize_changeset'] ) ) {
unset( $pc_post_types['customize_changeset'] );
}

if ( ! empty( $pc_post_types['oembed_cache'] ) ) {
unset( $pc_post_types['oembed_cache'] );
}

if ( ! empty( $pc_post_types['wp_block'] ) ) {
unset( $pc_post_types['wp_block'] );
}
$ignored_post_types = [
'custom_css',
'customize_changeset',
'ep-synonym',
'ep-pointer',
'nav_menu_item',
'oembed_cache',
'revision',
'user_request',
'wp_block',
'wp_global_styles',
'wp_navigation',
'wp_template',
'wp_template_part',
];

if ( ! empty( $pc_post_types['user_request'] ) ) {
unset( $pc_post_types['user_request'] );
foreach ( $ignored_post_types as $ignored_post_type ) {
if ( $pc_post_types[ $ignored_post_type ] ) {
unset( $pc_post_types[ $ignored_post_type ] );
}
}

// By default, attachments are not indexed, we have to make sure they are included (Could already be included by documents feature).
Expand Down

0 comments on commit 1e5c7a6

Please sign in to comment.