WordPress.org

Plugin Directory

Changeset 1695254


Ignore:
Timestamp:
07/12/17 15:07:08 (5 months ago)
Author:
petersplugins
Message:

v 3.1 DEV - current dev state

Location:
404page/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • 404page/trunk/404page.php

    r1691184 r1695254  
    1010 * Plugin URI: http://petersplugins.com/free-wordpress-plugins/404page/ 
    1111 * Description: Custom 404 the easy way! Set any page as custom 404 error page. No coding needed. Works with (almost) every Theme. 
    12  * Version: 3.0 
     12 * Version: 3.1 DEV 
    1313 * Author: Peter Raschendorfer 
    1414 * Author URI: http://petersplugins.com 
  • 404page/trunk/inc/class-404page.php

    r1691184 r1695254  
    4545      $this->plugin_name = '404page'; 
    4646      $this->plugin_slug = '404page'; 
    47       $this->version = '3.0'; 
     47      $this->version = '3.1 DEV'; 
    4848      $this->get_settings(); 
    4949      $this->load(); 
     
    248248              $pageid = apply_filters( 'wpml_object_id', $pageid, 'page', $sitepress->get_default_language() ); 
    249249               
     250            } elseif ( defined( 'POLYLANG_VERSION' ) ) { 
     251             
     252              // Polylang is active - get the post ID of the default language 
     253              $curpageid = pll_get_post( $curpageid, pll_default_language() ); 
     254              $pageid = pll_get_post( $pageid, pll_default_language() ); 
     255           
    250256            } 
    251257             
     
    841847     
    842848    /** 
    843      * get the id of the 404 page in the current language if WPML is active 
     849     * get the id of the 404 page in the current language if WPML or Polylang is active 
    844850     */ 
    845851    private function get_page_id() { 
     
    853859          // WPML is active 
    854860          $pageid = apply_filters( 'wpml_object_id', $pageid, 'page', true );  
     861         
     862        } elseif ( defined( 'POLYLANG_VERSION' ) ) { 
     863       
     864          // Polylang is active 
     865          $translatedpageid = pll_get_post( $pageid ); 
     866          if ( !empty( $translatedpageid ) && 'publish' == get_post_status( $translatedpageid ) ) { 
     867            $pageid = $translatedpageid; 
     868          } 
    855869         
    856870        } 
Note: See TracChangeset for help on using the changeset viewer.