PluginProbe
Hello Plus / 1.2.0
Hello Plus v1.2.0
trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 1.1.3 1.2.0 1.2.1 1.3.0 1.4.0 1.4.1 1.5.0 1.5.1 1.5.2 1.5.3 1.6.0 1.6.1 1.6.2 1.7.0 1.7.1 1.7.2 1.7.3 All 30 releases
hello-plus / modules / template-parts / documents / ehp-header.php

ehp-header.php in Hello Plus 1.2.0, at modules/template-parts/documents/ehp-header.php

54 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace HelloPlus\Modules\TemplateParts\Documents;
4
5 if ( ! defined( 'ABSPATH' ) ) {
6 exit; // Exit if accessed directly.
7 }
8
9 /**
10 * class Header
11 **/
12 class Ehp_Header extends Ehp_Document_Base {
13 const LOCATION = 'header';
14
15 public static function get_template_hook(): string {
16 return 'get_header';
17 }
18
19 public static function get_type(): string {
20 return 'ehp-header';
21 }
22
23 public static function get_title(): string {
24 return esc_html__( 'Hello+ Header', 'hello-plus' );
25 }
26
27 public static function get_plural_title(): string {
28 return esc_html__( 'Hello+ Headers', 'hello-plus' );
29 }
30
31 protected static function get_site_editor_icon(): string {
32 return 'eicon-header';
33 }
34
35 public static function get_template( $name, $args ): void {
36 require static::get_templates_path() . 'header.php';
37
38 $templates = [];
39 $name = (string) $name;
40 if ( '' !== $name ) {
41 $templates[] = "header-{$name}.php";
42 }
43
44 $templates[] = 'header.php';
45
46 // Avoid running wp_head hooks again
47 remove_all_actions( 'wp_head' );
48 ob_start();
49 // It causes a `require_once` so, in the get_header itself it will not be required again.
50 locate_template( $templates, true );
51 ob_get_clean();
52 }
53 }
54