C:\xampp\htdocs\landing\wp-content\updraft\themes-old\pennews\inc\customizer\02-topbar.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
<?php
$section_topbar  
'penci_topbar';
$wp_customize->add_section$section_topbar, array(
    
'title'       => esc_html__'Topbar Options''pennews' ),
    
'description' => esc_html__'The top bar is the black top menu. It is very useful when you want to add a login option, social icons and pages like About us, Contact us etc... ','pennews' ),
    
'priority'    => 2,
) );

// Enable Top Bar
$wp_customize->add_setting'penci_topbar_show', array(
    
'default'           => '',
    
'sanitize_callback' => array( $sanitizer'checkbox' ),
) );

$wp_customize->add_control( new WP_Customize_Control(
    
$wp_customize,
    
'penci_topbar_show',
    array(
        
'label'    => esc_html__'Enable Top Bar''pennews' ),
        
'section'  => $section_topbar,
        
'type'     => 'checkbox',
        
'settings' => 'penci_topbar_show',
    )
) );

$wp_customize->add_setting'penci_topbar_font_size', array(
    
'sanitize_callback' => array( $sanitizer'html' ),
) );

$wp_customize->add_control( new Penci_Customize_Font_Size_Control$wp_customize'penci_topbar_font_size', array(
    
'label'    => esc_html__'Custom Font Size For Top Bar''pennews' ),
    
'section'  => $section_topbar,
    
'settings' => 'penci_topbar_font_size',
    
'type'     => 'font_size',
) ) );

$wp_customize->add_setting'penci_topbar_turn_off_upearcase', array(
    
'sanitize_callback' => array( $sanitizer'text' ),
) );

$wp_customize->add_control( new WP_Customize_Control(
    
$wp_customize,
    
'penci_topbar_turn_off_upearcase',
    array(
        
'label'    => esc_html__'Turn Off Uppercase for Topbar Menu on Header Style 7''pennews' ),
        
'section'  => $section_topbar,
        
'type'     => 'checkbox',
        
'settings' => 'penci_topbar_turn_off_upearcase',
    )
) );

$wp_customize->add_setting'penci_topbar_width', array(
    
'sanitize_callback' => array( $sanitizer'text' ),
) );

$wp_customize->add_control'penci_topbar_width', array(
    
'label'    => esc_html__'Topbar Container Width''pennews' ),
    
'section'  => $section_topbar,
    
'settings' => 'penci_topbar_width',
    
'type'     => 'select',
    
'choices'  => array(
        
''                          => esc_html__'Default''pennews' ),
        
'penci-container-fullwidth' => esc_html__'FullWidth''pennews' ),
        
'penci-container-fluid'     => esc_html__'Width: 1400px''pennews' ),
        
'penci-container-1170'     => esc_html__'Width: 1170px''pennews' ),
        
'penci-container-1080'      => esc_html__'Width: 1080px''pennews' )
    )
) );


// Top bar Layout
$wp_customize->add_setting'penci_topbar_layout', array(
    
'default'           => 'style-1',
    
'sanitize_callback' => array( $sanitizer'select' ),
) );
$wp_customize->add_control( new Penci_Customize_Control_Radio_Image(
    
$wp_customize'penci_topbar_layout',
    array(
        
'label'    =>esc_html__'Top bar Layout''pennews' ),
        
'section'  => $section_topbar,
        
'type'     => 'radio-image',
        
'choices'  => array(
            
'style-1' => array( 'url' => '%s/images/topbar/style-1.png''label' => esc_html__'Style 1''pennews' ) ),
            
'style-2' => array( 'url' => '%s/images/topbar/style-2.png''label' => esc_html__'Style 2''pennews' ) ),
            
'style-3' => array( 'url' => '%s/images/topbar/style-3.png''label' => esc_html__'Style 3''pennews' ) ),
            
'style-4' => array( 'url' => '%s/images/topbar/style-4.png''label' => esc_html__'Style 4''pennews' ) ),

        ),
        
'settings' => 'penci_topbar_layout',
    )
) );
// Show trending
$wp_customize->add_setting'penci_topbar_trending_heading', array(
    
'sanitize_callback' => 'esc_url_raw'
) );
$wp_customize->add_control( new Penci_Customize_Heading_Control$wp_customize'penci_topbar_trending_heading', array(
    
'label'    => esc_html__'Trending''pennews' ),
    
'section'  => $section_topbar,
    
'settings' => 'penci_topbar_trending_heading',
    
'type'     => 'heading',
) ) );

$wp_customize->add_setting'penci_topbar_show_trending', array(
    
'default'           => 1,
    
'sanitize_callback' => array( $sanitizer'checkbox' ),
) );

$wp_customize->add_control( new WP_Customize_Control(
    
$wp_customize'penci_topbar_show_trending',
    array(
        
'label'    => esc_html__'Show trending''pennews' ),
        
'section'  => $section_topbar,
        
'type'     => 'checkbox',
        
'settings' => 'penci_topbar_show_trending',
        
'description' => ''
    
)
) );

$wp_customize->add_setting'penci_topbar_trending_text', array(
    
'sanitize_callback' => array( $sanitizer'html' ),
    
'default'           => penci_default_setting'penci_topbar_trending_text' ),
) );
$wp_customize->add_control'penci_topbar_trending_text', array(
    
'label'    => esc_html__'Custom "Trending now" Text''pennews' ),
    
'section'  => $section_topbar,
    
'settings' => 'penci_topbar_trending_text',
    
'description' => esc_html__'If you want to hide "Trending now" Text, Empty This Field''pennews' )
) );

$wp_customize->add_setting'penci_topbar_trending_text_fsize', array(
    
'sanitize_callback' => array( $sanitizer'html' ),
) );

$wp_customize->add_control( new Penci_Customize_Font_Size_Control$wp_customize'penci_topbar_trending_text_fsize', array(
    
'label'    => esc_html__'Custom Font Size For "Trending now" Text''pennews' ),
    
'section'  => $section_topbar,
    
'settings' => 'penci_topbar_trending_text_fsize',
    
'type'     => 'font_size',
) ) );

$wp_customize->add_setting'penci_topbar_trending_cat', array(
    
'default'           => '',
    
'sanitize_callback' => array( $sanitizer'select' ),
) );
$wp_customize->add_control'penci_topbar_trending_cat', array(
    
'label'    => esc_html__'Select "Trending now" Category''pennews' ),
    
'section'  => $section_topbar,
    
'settings' => 'penci_topbar_trending_cat',
    
'type'     => 'select',
    
'choices'  => penci_get_category()
) );

$wp_customize->add_setting'penci_topbar_trending_order', array(
    
'default'           => 'latest-posts',
    
'sanitize_callback' => array( $sanitizer'select' ),
) );
$wp_customize->add_control'penci_topbar_trending_order', array(
    
'label'    => esc_html__'Select Type''pennews' ),
    
'section'  => $section_topbar,
    
'settings' => 'penci_topbar_trending_order',
    
'type'     => 'select',
    
'choices' => array(
        
'popular7'      => esc_html__'Show Popular Posts in Once Week''pennews' ),
        
'popular_month' => esc_html__'Show Popular Posts in Once Month''pennews' ),
        
'popular'       => esc_html__'Show Popular Posts in All Times''pennews' ),
        
'latest-posts'  => esc_html__'Show Latest Posts''pennews' )
    )
) );

$wp_customize->add_setting'penci_topbar_trending_dis_auto', array(
    
'default'           => 1,
    
'sanitize_callback' => array( $sanitizer'checkbox' ),
) );

$wp_customize->add_control( new WP_Customize_Control(
    
$wp_customize'penci_topbar_trending_dis_auto',
    array(
        
'label'    => esc_html__'Disable Auto Play Posts on Top Bar''pennews' ),
        
'section'  => $section_topbar,
        
'type'     => 'checkbox',
        
'settings' => 'penci_topbar_trending_dis_auto',
        
'description' => ''
    
)
) );

$wp_customize->add_setting'penci_topbar_trending_autotime', array(
    
'sanitize_callback' => array( $sanitizer'html' ),
    
'default'           => '4000',
) );

$wp_customize->add_control( new Penci_Customize_Number_Control$wp_customize'penci_topbar_trending_autotime', array(
    
'label'    => esc_html__'Custom Auto Time Play Posts''pennews' ),
    
'section'  => $section_topbar,
    
'settings' => 'penci_topbar_trending_autotime',
    
'type'     => 'number',
) ) );

$wp_customize->add_setting'penci_topbar_trending_speed', array(
    
'sanitize_callback' => array( $sanitizer'html' ),
    
'default'           => '400',
) );

$wp_customize->add_control( new Penci_Customize_Number_Control$wp_customize'penci_topbar_trending_speed', array(
    
'label'    => esc_html__'Custom Auto Time Auto Speed''pennews' ),
    
'section'  => $section_topbar,
    
'settings' => 'penci_topbar_trending_speed',
    
'type'     => 'number',
) ) );

$wp_customize->add_setting'penci_topbar_trending_amount', array(
    
'sanitize_callback' => array( $sanitizer'html' ),
    
'default'           => '10',
) );

$wp_customize->add_control( new Penci_Customize_Number_Control$wp_customize'penci_topbar_trending_amount', array(
    
'label'    => esc_html__'Amount of Posts Display on Top Bar''pennews' ),
    
'section'  => $section_topbar,
    
'settings' => 'penci_topbar_trending_amount',
    
'type'     => 'number',
) ) );

$wp_customize->add_setting'penci_topbar_trending_num_words', array(
    
'sanitize_callback' => array( $sanitizer'html' ),
    
'default'           =>7,
) );

$wp_customize->add_control( new Penci_Customize_Number_Control$wp_customize'penci_topbar_trending_num_words', array(
    
'label'    => esc_html__'Amount Of Words For Post Title Display on Top Bar''pennews' ),
    
'section'  => $section_topbar,
    
'settings' => 'penci_topbar_trending_num_words',
    
'type'     => 'number',
) ) );

$wp_customize->add_setting'penci_topbar_trending_ptitle_fsize', array(
    
'sanitize_callback' => array( $sanitizer'html' ),
) );

$wp_customize->add_control( new Penci_Customize_Font_Size_Control$wp_customize'penci_topbar_trending_ptitle_fsize', array(
    
'label'    => esc_html__'Custom Font Size  Post Title Display on Top Bar''pennews' ),
    
'section'  => $section_topbar,
    
'settings' => 'penci_topbar_trending_ptitle_fsize',
    
'type'     => 'font_size',
) ) );

$wp_customize->add_setting'penci_topbar_trending_width', array(
    
'sanitize_callback' => array( $sanitizer'html' ),
    
'default'           => '500',
) );

$wp_customize->add_control( new Penci_Customize_Font_Size_Control$wp_customize'penci_topbar_trending_width', array(
    
'label'    => esc_html__'Width ( minimum width 300px )''pennews' ),
    
'section'  => $section_topbar,
    
'settings' => 'penci_topbar_trending_width',
    
'type'     => 'font_size',
) ) );


// Show menu
$wp_customize->add_setting'penci_topbar_menu_heading', array(
    
'sanitize_callback' => 'esc_url_raw'
) );
$wp_customize->add_control( new Penci_Customize_Heading_Control$wp_customize'penci_topbar_menu_heading', array(
    
'label'    => esc_html__'Menu''pennews' ),
    
'section'  => $section_topbar,
    
'settings' => 'penci_topbar_menu_heading',
    
'type'     => 'heading',
) ) );
$wp_customize->add_setting'penci_topbar_show_menu', array(
    
'default'           => '',
    
'sanitize_callback' => array( $sanitizer'checkbox' ),
) );

$wp_customize->add_control( new WP_Customize_Control(
    
$wp_customize'penci_topbar_show_menu',
    array(
        
'label'    => esc_html__'Show the topbar menu''pennews' ),
        
'section'  => $section_topbar,
        
'type'     => 'checkbox',
        
'settings' => 'penci_topbar_show_menu',
        
'description' => 'If you want to assign a menu for your topbar menu, please go to Appearance > Menus > create a new menu > scroll down and check to <strong>Topbar Menu</strong>'
    
)
) );

// Show socials
$wp_customize->add_setting'penci_topbar_socials_heading', array(
    
'sanitize_callback' => 'esc_url_raw'
) );
$wp_customize->add_control( new Penci_Customize_Heading_Control$wp_customize'penci_topbar_socials_heading', array(
    
'label'    => esc_html__'Social icons''pennews' ),
    
'section'  => $section_topbar,
    
'settings' => 'penci_topbar_socials_heading',
    
'type'     => 'heading',
) ) );
$wp_customize->add_setting'penci_topbar_show_socials', array(
    
'default'           => 1,
    
'sanitize_callback' => array( $sanitizer'checkbox' ),
) );

$wp_customize->add_control( new WP_Customize_Control(
    
$wp_customize'penci_topbar_show_socials',
    array(
        
'label'    => esc_html__'Show Social Icons''pennews' ),
        
'section'  => $section_topbar,
        
'type'     => 'checkbox',
        
'settings' => 'penci_topbar_show_socials',
        
'description' => ''
    
)
) );

$wp_customize->add_setting'penci_topbar_socials_fsize', array(
    
'sanitize_callback' => array( $sanitizer'html' ),
) );

$wp_customize->add_control( new Penci_Customize_Font_Size_Control$wp_customize'penci_topbar_socials_fsize', array(
    
'label'    => esc_html__'Custom Font Size For Social Icons''pennews' ),
    
'section'  => $section_topbar,
    
'settings' => 'penci_topbar_socials_fsize',
    
'type'     => 'font_size',
) ) );

// Show login and register
$wp_customize->add_setting'penci_topbar_login_heading', array(
    
'sanitize_callback' => 'esc_url_raw'
) );
$wp_customize->add_control( new Penci_Customize_Heading_Control$wp_customize'penci_topbar_login_heading', array(
    
'label'    => esc_html__'Login & Register''pennews' ),
    
'section'  => $section_topbar,
    
'settings' => 'penci_topbar_login_heading',
    
'type'     => 'heading',
) ) );

$wp_customize->add_setting'penci_topbar_show_signin', array(
    
'default'           => '',
    
'sanitize_callback' => array( $sanitizer'checkbox' ),
) );

$wp_customize->add_control( new WP_Customize_Control(
    
$wp_customize'penci_topbar_show_signin',
    array(
        
'label'       => esc_html__'Show Sign In / Join''pennews' ),
        
'section'     => $section_topbar,
        
'type'        => 'checkbox',
        
'settings'    => 'penci_topbar_show_signin',
        
'description' => esc_html__'By default, wordpress disable register user, if you want to make register form appears, please enable it via admin page > Settings > General > Membership > Anyone can register''pennews' )
    )
) );

$wp_customize->add_setting'penci_topbar_use_myaccount_url', array(
    
'default'           => '',
    
'sanitize_callback' => array( $sanitizer'checkbox' ),
) );

$wp_customize->add_control( new WP_Customize_Control(
    
$wp_customize'penci_topbar_use_myaccount_url',
    array(
        
'label'       => esc_html__'Enable my account page link Replace with URL of the author page''pennews' ),
        
'section'     => $section_topbar,
        
'type'        => 'checkbox',
        
'settings'    => 'penci_topbar_use_myaccount_url',
        
'description' => esc_html__'If it\'s enabled the option and woocommerce plugin is activated, the author link will show my account page link''pennews' )
    )
) );

$wp_customize->add_setting'penci_plogin_title_login', array(
    
'sanitize_callback' => array( $sanitizer'text' ),
    
'default'           => penci_default_setting'penci_plogin_title_login' ),
) );
$wp_customize->add_control'penci_plogin_title_login', array(
    
'label'    => esc_html__'Text for title login''pennews' ),
    
'section'  => $section_topbar,
    
'settings' => 'penci_plogin_title_login',
) );
$wp_customize->add_setting'penci_plogin_title_register', array(
    
'sanitize_callback' => array( $sanitizer'text' ),
    
'default'           => penci_default_setting'penci_plogin_title_register' ),
) );
$wp_customize->add_control'penci_plogin_title_register', array(
    
'label'    => esc_html__'Text for title register''pennews' ),
    
'section'  => $section_topbar,
    
'settings' => 'penci_plogin_title_register',
) );

// Show date
$wp_customize->add_setting'penci_topbar_date_heading', array(
    
'sanitize_callback' => 'esc_url_raw'
) );
$wp_customize->add_control( new Penci_Customize_Heading_Control$wp_customize'penci_topbar_date_heading', array(
    
'label'    => esc_html__'Date''pennews' ),
    
'section'  => $section_topbar,
    
'settings' => 'penci_topbar_date_heading',
    
'type'     => 'heading',
) ) );
$wp_customize->add_setting'penci_topbar_show_date', array(
    
'default'           => '',
    
'sanitize_callback' => array( $sanitizer'checkbox' ),
) );

$wp_customize->add_control( new WP_Customize_Control(
    
$wp_customize'penci_topbar_show_date',
    array(
        
'label'    => esc_html__'Show date''pennews' ),
        
'section'  => $section_topbar,
        
'type'     => 'checkbox',
        
'settings' => 'penci_topbar_show_date',
        
'description' => ''
    
)
) );

$wp_customize->add_setting'penci_topbar_date_format', array(
    
'sanitize_callback' => array( $sanitizer'text' ),
) );
$wp_customize->add_control'penci_topbar_date_format', array(
    
'label'    => esc_html__'Date format''pennews' ),
    
'section'  => $section_topbar,
    
'settings' => 'penci_topbar_date_format',
    
'description' => sprintf'Default value: %s. %s about the date format (it\'s the same with the php date function)',
        
get_option'date_format' ),
        
'<a href="' esc_url'https://codex.wordpress.org/Formatting_Date_and_Time' ) . '">' esc_html__'Read more','pennews' ) . '</a>'
    
)
) );


// Show weather
$wp_customize->add_setting'penci_topbar_weather_heading', array(
    
'sanitize_callback' => 'esc_url_raw'
) );
$wp_customize->add_control( new Penci_Customize_Heading_Control$wp_customize'penci_topbar_weather_heading', array(
    
'label'    => esc_html__'Weather''pennews' ),
    
'section'  => $section_topbar,
    
'settings' => 'penci_topbar_weather_heading',
    
'type'     => 'heading',
) ) );
$wp_customize->add_setting'penci_topbar_show_weather', array(
    
'default'           => '',
    
'sanitize_callback' => array( $sanitizer'checkbox' ),
) );

$wp_customize->add_control( new WP_Customize_Control(
    
$wp_customize'penci_topbar_show_weather',
    array(
        
'label'    => esc_html__'Show Weather''pennews' ),
        
'section'  => $section_topbar,
        
'type'     => 'checkbox',
        
'settings' => 'penci_topbar_show_weather',
        
'description' => ''
    
)
) );

$wp_customize->add_setting'penci_topbar_location_weather', array(
    
'sanitize_callback' => array( $sanitizer'text' ),
) );
$wp_customize->add_control'penci_topbar_location_weather', array(
    
'label'    => esc_html__'Location''pennews' ),
    
'section'  => $section_topbar,
    
'settings' => 'penci_topbar_location_weather',
    
'description' => sprintf'%s - You can use "city name" (ex: London) or "city name,country code" (ex: London,uk)%s',
        
'<a href="' esc_url'http://openweathermap.org/find' ) . '">' esc_html__'Find your location','pennews' ) . '</a>',
        
'</br><a target="_bank" href="' esc_url'https://image.prntscr.com/image/7WsPGQsATS6yT6TF1Bt8gQ.png' ) . '"><img alt="Location" src="' esc_url'https://image.prntscr.com/image/7WsPGQsATS6yT6TF1Bt8gQ.png' ) . '"/></a>'
    
)
) );
$wp_customize->add_setting'penci_topbar_weather_display', array(
    
'sanitize_callback' => array( $sanitizer'text' ),
) );
$wp_customize->add_control'penci_topbar_weather_display', array(
    
'label'    => esc_html__'Location Display''pennews' ),
    
'section'  => $section_topbar,
    
'settings' => 'penci_topbar_weather_display',
    
'description' => esc_html__'If the option is empty,will display results from ''pennews' ) . '<a href="' esc_url'http://openweathermap.org/find' ) . '">openweathermap.org</a>',
) );

$wp_customize->add_setting'penci_topbar_weather_units', array(
    
'default'           => 'metric',
    
'sanitize_callback' => array( $sanitizer'select' ),
) );
$wp_customize->add_control'penci_topbar_weather_units', array(
    
'label'    => esc_html__'Units''pennews' ),
    
'section'  => $section_topbar,
    
'settings' => 'penci_topbar_weather_units',
    
'type'     => 'select',
    
'choices'  => array(
        
'metric' => esc_html__'Celsius','pennews' ),
        
'imperial' => esc_html__'Fahrenheit','pennews' ),
    )
) );
x

Windows NT KPTV 6.2 build 9200 (Windows Server 2012 Datacenter Edition) i586