WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#13145 closed defect (bug) (wontfix)

overly greedy home page url setting

Reported by: usermrpapa Owned by: ryan
Milestone: Priority: high
Severity: major Version: 3.0
Component: Rewrite Rules Keywords:
Focuses: Cc:

Description

we are having an issue with displaying a static page on the front page with WP 3.0.

Our plugin (a forum plugin) actually dynamically generates its page content and displays it on the single WP page. Additionally, we generate a series of rewrite rules for the appearance of pseudo pages/subpages on this single WP page (ie forum and topic pages)

In previous WP versions we have been able to have our page be used as the static front page for WP sites, but this has stopped functioning in WP 3.0.

I believe we have traced it down to a change in wp-includes/canonical.php at lines 103 and 104:

} elseif ( is_page() && !is_feed() && isset($wp_query->queried_object) && 'page' == get_option('show_on_front') && $wp_query->queried_object->ID == get_option('page_on_front')  && ! $redirect_url ) {
$redirect_url = home_url('/');

Basically, here a decision was made that if it is a page set as the 'home/front' link then just simple throw away the url and use the home_url.

This appears a bit 'greedy' and bypasses any url rewriting done for that page. It also will 'break' any plugin (ecommerce also comes to mind) that dynamically generats page content and tries to be set as the front page.

Seems like this direct shouldn't be so absolute to the home url. Or at a minimum, plugins should be able to override/filter this.

thoughts?

Change History (4)

comment:1 usermrpapa4 years ago

  • Cc steve@… added

comment:2 usermrpapa4 years ago

actually, digging in a bit further, there appears to be a filter located earlier in the code that we can use to override this hard code redirect

$redirect_url = apply_filters('redirect_canonical', $redirect_url, $requested_url);

so we are testing that filter to see if we can accomplish what we want... will report back...

comment:3 usermrpapa4 years ago

  • Resolution set to wontfix
  • Status changed from new to closed
  • Version set to 3.0

okay, a bit clunky/kludgy, but we are able to use the filter successfully to work around this change. will go ahead and close.

comment:4 nacin4 years ago

  • Milestone Unassigned deleted
Note: See TracTickets for help on using tickets.