Last active
May 2, 2025 23:43
-
-
Save joshuadavidnelson/33e1948e08fdc42f758ed3b8c083c639 to your computer and use it in GitHub Desktop.
Revisions
-
joshuadavidnelson revised this gist
Aug 9, 2022 . 1 changed file with 4 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,4 @@ <?php /** * Filter the post search arguments allow for cross-post-type connections. * @@ -19,4 +17,6 @@ function remote_post_search_arguments( $args ) { } return $args; } add_filter( 'multilingualpress.remote_post_search_arguments', 'jdn_remote_post_search_arguments', 100, 1 ); -
joshuadavidnelson created this gist
Aug 9, 2022 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ // Cross-post-type connections. add_filter( 'multilingualpress.remote_post_search_arguments', 'jdn_remote_post_search_arguments', 100, 1 ); /** * Filter the post search arguments allow for cross-post-type connections. * * @param array $args the WP_Query arguments used. * @return array */ function remote_post_search_arguments( $args ) { $translated_post_types = array( 'post', 'page', 'product' ); if ( isset( $args['post_type'] ) && is_string( $args['post_type'] ) && in_array( $args['post_type'], $translated_post_types, true ) ) { $args['post_type'] = $translated_post_types; } return $args; }