PluginProbe
Property Hive / 2.3.0
Property Hive v2.3.0
2.3.1 2.3.0 2.2.6 2.2.5 2.2.4 2.2.3 2.2.2 1.4.46 1.4.47 1.4.48 1.4.49 1.4.5 1.4.50 1.4.51 1.4.52 1.4.53 1.4.54 1.4.55 1.4.56 1.4.57 1.4.58 1.4.59 1.4.6 1.4.60 1.4.61 All 261 releases
propertyhive / includes / admin / post-types / class-ph-admin-header-stripes.php

class-ph-admin-header-stripes.php in Property Hive 2.3.0, at includes/admin/post-types/class-ph-admin-header-stripes.php

63 lines 2.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * PropertyHive Header Stripes
4 *
5 *
6 *
7 * @author PropertyHive
8 * @category Admin
9 * @package PropertyHive/Admin/Header Stripes
10 * @version 1.0.0
11 */
12
13 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
14
15 /**
16 * PH_Admin_Header_Stripes
17 */
18 // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedClassFound -- Legacy public global class PH_Admin_Header_Stripes; preserving the existing PH_* class name is required for plugin and extension compatibility.
19 class PH_Admin_Header_Stripes {
20
21 /**
22 * Constructor
23 */
24 public function __construct() {
25
26 //add_action( 'edit_form_top', array( $this, 'add_header_stripe' ), 10, 1 );
27
28 }
29
30 /**
31 * Add PH Header Stripe
32 */
33 public function add_header_stripe( $post ) {
34
35 global $post, $propertyhive, $property;
36
37 if ($post->post_status != 'auto-draft')
38 {
39 if ($post->post_type == 'property')
40 {
41 // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- The public property rendering helpers consume this shared property context.
42 $property = new PH_Property((int)$post->ID);
43
44 echo '<div style="background:#2ea2cc; border:1px solid #0074a2; border-radius:4px; padding:10px 15px; color:#FFF;">';
45
46 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Thumbnail producer escapes image URL/title/class and placeholder dimensions before the trusted propertyhive_placeholder_img HTML filter; preserve extension image markup.
47 echo propertyhive_get_property_thumbnail('thumbnail', 'alignleft');
48
49 echo '<h1>' . esc_html(get_the_title($post->ID)) . '</h1>';
50 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Price producers escape stored text before trusted propertyhive_price_output and commercial child HTML filters; preserve extension formatting.
51 echo '<h3>' . $property->get_formatted_price() . '</h3>';
52
53 echo '<div class="clear"></div>';
54
55 echo '</div>';
56 }
57 }
58
59 }
60
61 }
62
63 new PH_Admin_Header_Stripes();