PluginProbe
LoginPress | wp-login Custom Login Page Customizer / 1.1.3
LoginPress | wp-login Custom Login Page Customizer v1.1.3
6.2.5 6.2.4 6.2.3 6.2.2 6.2.1 trunk 1.0.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.17 1.0.18 1.0.19 1.0.2 1.0.20 1.0.21 1.0.22 1.0.23 1.0.3 1.0.4 All 118 releases
loginpress / classes / control-promo.php

control-promo.php in LoginPress | wp-login Custom Login Page Customizer 1.1.3, at classes/control-promo.php

154 lines 3.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Class for Promotion.
5 *
6 * @since 1.0.17
7 * @access public
8 */
9 class LoginPress_Promo extends WP_Customize_Control {
10
11 /**
12 * The type of customize control being rendered.
13 *
14 * @since 1.0.17
15 * @access public
16 * @var string
17 */
18 public $type = 'promotion';
19
20 /**
21 * The type of customize control being rendered.
22 *
23 * @since 1.0.17
24 * @access public
25 * @var string
26 */
27 public $thumbnail;
28
29 /**
30 * Promotion text for <the> Controler</the>.
31 *
32 * @since 1.0.17
33 * @access public
34 * @var string
35 */
36 public $promo_text;
37
38 /**
39 * Promotion link for the Controler
40 *
41 * @since 1.0.17
42 * @access public
43 * @var string
44 */
45 public $link;
46
47 /**
48 * Enqueue scripts/styles.
49 *
50 * @since 1.0.17
51 * @access public
52 * @return void
53 */
54 public function enqueue() {
55 // wp_enqueue_script( 'jt-customize-controls', plugins_url( '/customize-controls.js' , __FILE__ ), array( 'jquery' ) );
56 // wp_enqueue_script( 'jquery-ui-button' );
57 }
58
59 /**
60 * Displays the control content.
61 *
62 * @since 1.0.17
63 * @access public
64 * @return void
65 */
66 public function render_content() {
67 ?>
68
69 <span class="customize-control-title">
70 <?php echo esc_attr( $this->label ); ?>
71 <?php if ( ! empty( $this->description ) ) : ?>
72 <span class="description customize-control-description"><?php echo esc_html( $this->description ); ?></span>
73 <?php endif; ?>
74 </span>
75
76
77 <div id="input_<?php echo $this->id; ?>" class="image">
78
79 <div class="loginpress_promo_thumbnail">
80 <a href="<?php echo esc_url( $this->link );?>" target="_blank">
81 <div class="customizer-promo-overlay">
82 <span class="customizer-promo-text"><?php echo esc_html( $this->promo_text ); ?></span>
83 </div>
84 <img src="<?php echo esc_url( $this->thumbnail ); ?>" alt="<?php echo esc_attr( $this->id ); ?>" title="<?php echo esc_attr( $this->id ); ?>">
85 </a>
86 </div> <!-- .loginpress_promo_thumbnail -->
87
88 </div>
89
90 <?php }
91
92
93 }
94 function loginpress_promo_control_css() {
95 ?>
96 <style>
97 .loginpress_promo_thumbnail a{
98 display: inline-block;
99 position: relative;
100 border:5px solid transparent;
101 }
102 .loginpress_promo_thumbnail a .customizer-promo-overlay{
103 position: absolute;
104 top: 0;
105 left: 0;
106 width: 100%;
107 height: 100%;
108 background: rgba(204, 204, 204, 0.8);
109 content: '';
110 -webkit-transition: all 0.2s ease-in-out;
111 -moz-transition: all 0.2s ease-in-out;
112 -ms-transition: all 0.2s ease-in-out;
113 transition: all 0.2s ease-in-out;
114 opacity: 0;
115 visibility: hidden;
116 -webkit-transform: scale(.5);
117 -moz-transform: scale(.5);
118 -ms-transform: scale(.5);
119 transform: scale(.5);
120 }
121 .customizer-promo-text{
122 line-height:1.2;
123 position: absolute;
124 top: 50%;
125 left: 50%;
126 -webkit-transform:translate(-50%, -50%);
127 transform:translate(-50%, -50%);
128 width: 100%;
129 font-size: 25px;
130 color: #000;
131 z-index: 100;
132 text-align: center;
133 opacity: 0;
134 }
135 .loginpress_promo_thumbnail a:hover{
136 border-color: #ccc;
137 }
138 .loginpress_promo_thumbnail a:hover .customizer-promo-text{
139 opacity: 1;
140 }
141 .loginpress_promo_thumbnail a:hover .customizer-promo-overlay{
142 opacity: 1;
143 visibility: visible;
144 -webkit-transform: scale(1);
145 -moz-transform: scale(1);
146 -ms-transform: scale(1);
147 transform: scale(1);
148 }
149 </style>
150 <?php
151 }
152 add_action( 'customize_controls_print_styles', 'loginpress_promo_control_css' );
153 ?>
154