Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ Custom Error Pages
==================
This is the development version of this plugin.

* Download the [latest stable version](http://downloads.wordpress.org/plugin/custom-error-pages.latest-stable.zip)
* Official homepage - http://jesin.tk/wordpress-plugins/custom-error-pages/
* WordPress plugin repository - http://wordpress.org/plugins/custom-error-pages/
* Download the [latest stable version](https://downloads.wordpress.org/plugin/custom-error-pages.latest-stable.zip)
* Official homepage - https://websistent.com/wordpress-plugins/custom-error-pages/
* WordPress plugin repository - https://wordpress.org/plugins/custom-error-pages/
2 changes: 2 additions & 0 deletions comments_disabler.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?php
// This is a empty template made to hide comments for generated error pages
12 changes: 10 additions & 2 deletions plugin.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php
/*
Plugin Name: Custom Error Pages
Plugin URI: http://websistent.com/wordpress-plugins/custom-error-pages/
Plugin URI: https://websistent.com/wordpress-plugins/custom-error-pages/
Description: Create custom 401 and 403 error pages with any WordPress theme without writing a single line of code, set it up and forget it.
Author: Jesin
Author URI: http://websistent.com
Author URI: https://websistent.com
Version: 1.1
*/

Expand Down Expand Up @@ -33,6 +33,7 @@ function __construct()
add_action( 'init', array( $this, 'plugin_init' ) );
add_filter( 'query_vars', array( $this, 'add_status_query_var' ) ); //Add a custom query variable
add_action( 'parse_request', array( $this, 'get_status_query_var' ) ); //Check if the custom query variable exists
add_filter( 'comments_template', array( $this, 'plugin_disable_comments' ) );
}

function plugin_init()
Expand Down Expand Up @@ -64,6 +65,13 @@ function get_status_query_var( &$wp )
$create_custom_error_pages = new Create_Custom_Error_Pages( array( 'options' => $this->options, 'code' => $status ) );
}
}

function plugin_disable_comments( $comment_template ) {
global $post;
if( $post->ID == 0 ) {
return dirname( __FILE__ ) . '/comments_disabler.php';
}
}
}

//The Class which creates a "Virtual Page"
Expand Down
4 changes: 2 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ WordPress offers inbuilt support for custom 404 pages on all themes. But what ab
With this plugin you can easily create custom 401 and 403 error pages with any theme without writing a single line of code!!! And the best part is that you set it and forget it. Yes, you don't have to do any changes even if you change themes. The heading and text you want on 401 and 403 error pages are displayed on the currently active theme.

= Further Reading =
* [Create WordPress 401 and 403 error pages](http://websistent.com/wordpress-custom-403-401-error-page/) WITHOUT using this plugin
* The [Custom Error Pages Plugin](http://websistent.com/wordpress-plugins/custom-error-pages/) official homepage.
* [Create WordPress 401 and 403 error pages](https://websistent.com/wordpress-custom-403-401-error-page/) WITHOUT using this plugin
* The [Custom Error Pages Plugin](https://websistent.com/wordpress-plugins/custom-error-pages/) official homepage.

== Installation ==

Expand Down