PluginProbe ʕ •ᴥ•ʔ
Smart Custom 404 Error Page / trunk
Smart Custom 404 Error Page vtrunk
trunk 11.4.6 11.4.7 11.4.8
404page / inc / class-404page-settings.php
404page / inc Last commit date
admin 1 year ago ppf 1 year ago class-404page-admin.php 1 year ago class-404page-block-editor.php 1 year ago class-404page-classic-editor.php 1 year ago class-404page-deprecated.php 1 year ago class-404page-settings.php 1 year ago class-404page.php 1 year ago index.php 9 years ago
class-404page-settings.php
71 lines
1 <?php
2
3 /**
4 * The 404page settings plugin class
5 *
6 * @since 7
7 *
8 * taken from 404page core class and outsourced to a seperate class in version 7
9 */
10
11 if ( ! defined( 'ABSPATH' ) ) {
12 exit; // Exit if accessed directly
13 }
14
15 /**
16 * The settings plugin class
17 */
18 if ( !class_exists( 'PP_404Page_Settings' ) ) {
19
20 class PP_404Page_Settings extends PPF09_Settings {
21
22 /**
23 * sanitize settings
24 *
25 * @since 11.0.0
26 * @access public
27 */
28 public function sanitize_settings() {
29
30 // Set page ID to -1 if the page does not exist or is not published
31
32 if ( $this->get( 'page_id' ) != 0 ) {
33
34 $page = get_post( $this->get( 'page_id' ) );
35
36 if ( !$page || $page->post_status != 'publish' ) {
37
38 $this->set( 'page_id', -1 );
39
40 }
41
42 }
43
44 }
45
46
47 /**
48 * set the method
49 *
50 * @since 7
51 * @access public
52 */
53 public function set_method() {
54
55 if ( defined( 'ICL_SITEPRESS_VERSION' ) ) {
56
57 // WPML is active
58 $this->set('method', 'CMP' );
59
60 } else {
61
62 // we dont' need to set this here, because this is set in load()
63
64 }
65
66 }
67
68
69 }
70
71 }