Skip to content

Commit

Permalink
Remove wpcom_vip_get_page_by_path
Browse files Browse the repository at this point in the history
Removes the now deprecated `wpcom_vip_get_page_by_path` function and bumps the minimum WordPress vesrion to 6.1.
The alternative is to wrap the function in a `version_compare` statement but as 6.1 is nearly 2 years old, and 5 versions ago and this PR is going into a develop branch a version bump seems logical.
Fixes #134
  • Loading branch information
BrookeDot committed Sep 16, 2024
1 parent eeb5536 commit def396f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
6 changes: 1 addition & 5 deletions includes/class-wpcom-legacy-redirector.php
Original file line number Diff line number Diff line change
Expand Up @@ -360,12 +360,8 @@ public static function check_if_404( $url ) {
*/
public static function vip_legacy_redirect_check_if_public( $excerpt ) {
$post_types = get_post_types();
$post_obj = get_page_by_path( $excerpt, OBJECT, $post_types );

if ( function_exists( 'wpcom_vip_get_page_by_path' ) ) {
$post_obj = wpcom_vip_get_page_by_path( $excerpt, OBJECT, $post_types );
} else {
$post_obj = get_page_by_path( $excerpt, OBJECT, $post_types );
}
if ( ! is_null( $post_obj ) ) {
if ( 'publish' !== get_post_status( $post_obj->ID ) ) {
return 'private';
Expand Down
1 change: 1 addition & 0 deletions wpcom-legacy-redirector.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* Description: Simple plugin for handling legacy redirects in a scalable manner.
* Version: 1.4.0-alpha
* Requires PHP: 7.4
* Requires at least: 6.1
* Author: Automattic / WordPress VIP
* Author URI: https://wpvip.com
*
Expand Down

0 comments on commit def396f

Please sign in to comment.