Version Description
(2016-11-21) = * a few minor bug fixes solve some problems with page templates in certain combinations
Download this release
Release Info
Developer | smartware.cc |
Plugin | 404page – your smart custom 404 error page |
Version | 2.3 |
Comparing to | |
See all releases |
Code changes from version 2.2 to 2.3
- 404page.php +18 -9
- readme.txt +6 -5
404page.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: 404page - your smart custom 404 error page
|
4 |
Plugin URI: http://petersplugins.com/free-wordpress-plugins/404page/
|
5 |
Description: Custom 404 the easy way! Set any page as custom 404 error page. No coding needed. Works with (almost) every Theme.
|
6 |
-
Version: 2.
|
7 |
Author: Peter's Plugins, smartware.cc
|
8 |
Author URI: http://petersplugins.com
|
9 |
Text Domain: 404page
|
@@ -32,7 +32,7 @@ class Smart404Page {
|
|
32 |
public function __construct() {
|
33 |
$this->plugin_name = '404page';
|
34 |
$this->plugin_slug = '404page';
|
35 |
-
$this->version = '2.
|
36 |
$this->get_settings();
|
37 |
$this->init();
|
38 |
}
|
@@ -193,9 +193,10 @@ class Smart404Page {
|
|
193 |
// this function overrides the page template in compatibilty mode
|
194 |
function change_404_template( $template ) {
|
195 |
// we have to check if the template file is there because if the theme was changed maybe a wrong template is stored in the database
|
196 |
-
|
197 |
-
|
198 |
-
|
|
|
199 |
return $template;
|
200 |
}
|
201 |
|
@@ -342,15 +343,23 @@ class Smart404Page {
|
|
342 |
function exclude_404page( $query ) {
|
343 |
if ( $this->settings['404page_page_id'] > 0 ) {
|
344 |
global $pagenow;
|
345 |
-
|
|
|
|
|
|
|
|
|
346 |
$pageid = $this->settings['404page_page_id'];
|
|
|
347 |
if ( ! is_admin() ) {
|
348 |
$pageid = $this->get_page_id( $pageid );
|
349 |
}
|
350 |
-
|
|
|
|
|
|
|
|
|
351 |
}
|
352 |
}
|
353 |
-
return $query;
|
354 |
}
|
355 |
|
356 |
// this function removes the 404 page from get_pages result array
|
@@ -447,7 +456,7 @@ class Smart404Page {
|
|
447 |
return (bool)get_option( '404page_fire_error', true );
|
448 |
}
|
449 |
|
450 |
-
//
|
451 |
private function get_page_id( $pageid ) {
|
452 |
|
453 |
if ( defined( 'ICL_SITEPRESS_VERSION' ) ) {
|
3 |
Plugin Name: 404page - your smart custom 404 error page
|
4 |
Plugin URI: http://petersplugins.com/free-wordpress-plugins/404page/
|
5 |
Description: Custom 404 the easy way! Set any page as custom 404 error page. No coding needed. Works with (almost) every Theme.
|
6 |
+
Version: 2.3
|
7 |
Author: Peter's Plugins, smartware.cc
|
8 |
Author URI: http://petersplugins.com
|
9 |
Text Domain: 404page
|
32 |
public function __construct() {
|
33 |
$this->plugin_name = '404page';
|
34 |
$this->plugin_slug = '404page';
|
35 |
+
$this->version = '2.3';
|
36 |
$this->get_settings();
|
37 |
$this->init();
|
38 |
}
|
193 |
// this function overrides the page template in compatibilty mode
|
194 |
function change_404_template( $template ) {
|
195 |
// we have to check if the template file is there because if the theme was changed maybe a wrong template is stored in the database
|
196 |
+
$new_template = locate_template( array( $this->template ) );
|
197 |
+
if ( '' != $new_template ) {
|
198 |
+
return $new_template ;
|
199 |
+
}
|
200 |
return $template;
|
201 |
}
|
202 |
|
343 |
function exclude_404page( $query ) {
|
344 |
if ( $this->settings['404page_page_id'] > 0 ) {
|
345 |
global $pagenow;
|
346 |
+
|
347 |
+
$post_type = $query->get( 'post_type' );
|
348 |
+
|
349 |
+
// as of v 2.3 we check the post_type on front end
|
350 |
+
if( ( is_admin() && ( 'edit.php' == $pagenow && !current_user_can( 'create_users' ) ) ) || ( ! is_admin() && ( !empty( $post_type) && ( ('page' === $post_type || 'any' === $post_type) || ( is_array( $post_type ) && in_array( 'page', $post_type ) ) ) )) ) {
|
351 |
$pageid = $this->settings['404page_page_id'];
|
352 |
+
|
353 |
if ( ! is_admin() ) {
|
354 |
$pageid = $this->get_page_id( $pageid );
|
355 |
}
|
356 |
+
|
357 |
+
// as of v 2.3 we add the ID of the 404 page to post__not_in
|
358 |
+
// using just $query->set() overrides existing settings but not adds a new setting
|
359 |
+
$query->set( 'post__not_in', array_merge( (array)$query->get( 'post__not_in', array() ), array( $pageid ) ) );
|
360 |
+
|
361 |
}
|
362 |
}
|
|
|
363 |
}
|
364 |
|
365 |
// this function removes the 404 page from get_pages result array
|
456 |
return (bool)get_option( '404page_fire_error', true );
|
457 |
}
|
458 |
|
459 |
+
// this function gets the id of the translated page if WPML or Polylang is active - otherwise the original pageid is returned
|
460 |
private function get_page_id( $pageid ) {
|
461 |
|
462 |
if ( defined( 'ICL_SITEPRESS_VERSION' ) ) {
|
readme.txt
CHANGED
@@ -3,8 +3,8 @@ Contributors: petersplugins, smartware.cc
|
|
3 |
Donate link:http://petersplugins.com/make-a-donation/
|
4 |
Tags: page, 404, error, error page, 404 page, page not found, page not found error, 404 error page, missing, broken link, template, 404 link, seo, custom 404, custom 404 page, custom 404 error, custom 404 error page, customize 404, customize 404 page, customize 404 error page
|
5 |
Requires at least: 3.0
|
6 |
-
Tested up to: 4.
|
7 |
-
Stable tag: 2.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -16,9 +16,6 @@ Custom 404 the easy way! Set any page as custom 404 error page. No coding needed
|
|
16 |
|
17 |
**See also [Plugin Homepage](http://petersplugins.com/free-wordpress-plugins/404page/) and [Plugin Doc](http://petersplugins.com/docs/404page/)**
|
18 |
|
19 |
-
= Version 2.2 Update Notice =
|
20 |
-
Please note that the Plugin **no longer switches to Compatibility Mode automatically** under certain conditions. Trying to identify several configurations where Compatibility Mode is required caused some other problems. Take a look at the [release notes](http://petersplugins.com/blog/2016/09/26/404page-version-2-2-a-lot-of-changes-under-the-hood).
|
21 |
-
|
22 |
https://www.youtube.com/watch?v=VTL07Lf0IsY
|
23 |
|
24 |
Create your custom 404 Page as a normal WordPress Page using the full power of WordPress. You can use a Custom Page Template or Custom Fields, you can set a Featured Image - everything like on every other Page. Then go to 'Appearance' -> '404 Error Page' from your WordPress Dashbord and select the created Page as your 404 error page. That's it!
|
@@ -83,6 +80,9 @@ The 404page plugin adds a CSS class `error404` to the `<body>` tag which can be
|
|
83 |
|
84 |
== Changelog ==
|
85 |
|
|
|
|
|
|
|
86 |
= 2.2 (2016-09-26) =
|
87 |
* automatic switch to Compatibility Mode for several plugins removed
|
88 |
* enhanced support for WPML and Polylang
|
@@ -168,6 +168,7 @@ Editing of the 404 page is now possible directly from settings page. Portuguese
|
|
168 |
* [Twenty Fourteen](https://wordpress.org/themes/twentyfourteen/)
|
169 |
* [Twenty Fifteen](https://wordpress.org/themes/twentyfifteen/)
|
170 |
* [Twenty Sixteen](https://wordpress.org/themes/twentysixteen/)
|
|
|
171 |
* [Vantage](https://wordpress.org/themes/vantage/)
|
172 |
* [Virtue](https://wordpress.org/themes/virtue/)
|
173 |
* [Zerif Lite](http://themeisle.com/themes/zerif-lite/)
|
3 |
Donate link:http://petersplugins.com/make-a-donation/
|
4 |
Tags: page, 404, error, error page, 404 page, page not found, page not found error, 404 error page, missing, broken link, template, 404 link, seo, custom 404, custom 404 page, custom 404 error, custom 404 error page, customize 404, customize 404 page, customize 404 error page
|
5 |
Requires at least: 3.0
|
6 |
+
Tested up to: 4.7
|
7 |
+
Stable tag: 2.3
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
16 |
|
17 |
**See also [Plugin Homepage](http://petersplugins.com/free-wordpress-plugins/404page/) and [Plugin Doc](http://petersplugins.com/docs/404page/)**
|
18 |
|
|
|
|
|
|
|
19 |
https://www.youtube.com/watch?v=VTL07Lf0IsY
|
20 |
|
21 |
Create your custom 404 Page as a normal WordPress Page using the full power of WordPress. You can use a Custom Page Template or Custom Fields, you can set a Featured Image - everything like on every other Page. Then go to 'Appearance' -> '404 Error Page' from your WordPress Dashbord and select the created Page as your 404 error page. That's it!
|
80 |
|
81 |
== Changelog ==
|
82 |
|
83 |
+
= 2.3 (2016-11-21) =
|
84 |
+
* a few minor bug fixes solve some problems with page templates in certain combinations
|
85 |
+
|
86 |
= 2.2 (2016-09-26) =
|
87 |
* automatic switch to Compatibility Mode for several plugins removed
|
88 |
* enhanced support for WPML and Polylang
|
168 |
* [Twenty Fourteen](https://wordpress.org/themes/twentyfourteen/)
|
169 |
* [Twenty Fifteen](https://wordpress.org/themes/twentyfifteen/)
|
170 |
* [Twenty Sixteen](https://wordpress.org/themes/twentysixteen/)
|
171 |
+
* [Twenty Seventeen](https://wordpress.org/themes/twentyseventeen/)
|
172 |
* [Vantage](https://wordpress.org/themes/vantage/)
|
173 |
* [Virtue](https://wordpress.org/themes/virtue/)
|
174 |
* [Zerif Lite](http://themeisle.com/themes/zerif-lite/)
|