Ejemplo n.º 1
0
 public function onfront($request, WP_Query $wp_query)
 {
     if (ShoppCatalogPage::frontid() == get_option('page_on_front')) {
         // @todo Detect when the catalog page is directly accessed by slug and redirect it to website root when it is set to page on front
         if (ShoppCatalogPage::frontid() == $wp_query->get('page_id')) {
             // Overrides to enforce page behavior
             $wp_query->set(ShoppPages::QUERYVAR, ShoppPages()->baseslug());
             $wp_query->is_page = true;
             $wp_query->is_singular = true;
             $wp_query->post_count = true;
             $wp_query->shopp_page = true;
             $wp_query->is_archive = false;
             $request = str_replace('.ID = shopp', '.ID = NULL', $request);
         }
     }
     return $request;
 }
Ejemplo n.º 2
0
 /**
  * Filters the page_on_front option during save to handle the bigint on non 64-bit environments
  *
  * @since 1.3
  *
  * @param mixed $value The value to save
  * @return mixed The value to save
  **/
 public function frontpage($value)
 {
     if (!isset($_POST['page_on_front'])) {
         return $value;
     }
     $shoppid = ShoppCatalogPage::frontid();
     // uses impossibly long number ("Shopp" in decimal)
     if ($_POST['page_on_front'] == $shoppid) {
         return "{$shoppid}";
     } else {
         return $value;
     }
 }