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-classic-editor.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-classic-editor.php
62 lines
1 <?php
2
3 /**
4 * The 404page classic editor plugin class
5 *
6 * @since 9
7 */
8
9 if ( ! defined( 'ABSPATH' ) ) {
10 exit; // Exit if accessed directly
11 }
12
13 /**
14 * The classic editor plugin class
15 */
16 if ( !class_exists( 'PP_404Page_ClassicEditor' ) ) {
17
18 class PP_404Page_ClassicEditor extends PPF09_SubClass {
19
20 /**
21 * Do Init
22 *
23 * @since 9
24 * @access public
25 */
26 public function init() {
27
28 add_action( 'admin_head', array( $this, 'admin_style' ) );
29
30 }
31
32
33 /**
34 * Add Classic Editor Style to Header if currently edited page is a custom 404 error page
35 *
36 * @since 9
37 * @access public
38 */
39 public function admin_style() {
40
41 // we just ignore whether Gutenberg is used or not, because this classes do not exist if Gutenberg is active
42 if ( get_current_screen()->id == 'page' && $this->settings()->get( 'page_id' ) > 0 ) {
43
44 global $post;
45
46 $all404pages = $this->core()->get_all_page_ids();
47 if ( in_array( $post->ID, $all404pages ) ) {
48
49 ?>
50 <style type="text/css">
51 #post-body-content:before { content: "<?php esc_html_e( 'You are currently editing your custom 404 error page', '404page'); ?>"; background-color: #333; color: #FFF; padding: 8px; font-size: 16px; display: block; margin-bottom: 10px };
52 </style>
53 <?php
54
55 }
56 }
57
58 }
59
60 }
61
62 }