@@ -370,6 +370,96 @@ public function staff_custom_column( $columns ) {
370
370
return $ columns ;
371
371
}
372
372
373
+ /**
374
+ * Add custom column data to lfe_speaker admin display.
375
+ *
376
+ * @param string $column The column.
377
+ * @param int $post_id The post.
378
+ * @return void
379
+ */
380
+ public function speaker_custom_column_data ( $ column , $ post_id ) {
381
+ switch ( $ column ) {
382
+ case 'title_company ' :
383
+ echo get_post_meta ( $ post_id , 'lfes_speaker_title ' , true ) ? get_post_meta ( $ post_id , 'lfes_speaker_title ' , true ) : "- " ;
384
+ break ;
385
+ case 'linkedin_url ' :
386
+ echo get_post_meta ( $ post_id , 'lfes_speaker_linkedin ' , true ) ? '<span class="dashicons dashicons-yes-alt" style="color:green"></span> ' : '<span class="dashicons dashicons-no-alt" style="color:red"></span> ' ;
387
+ break ;
388
+ case 'twitter_url ' :
389
+ echo get_post_meta ( $ post_id , 'lfes_speaker_twitter ' , true ) ? '<span class="dashicons dashicons-yes-alt" style="color:green"></span> ' : '<span class="dashicons dashicons-no-alt" style="color:red"></span> ' ;
390
+ break ;
391
+ case 'website_url ' :
392
+ echo get_post_meta ( $ post_id , 'lfes_speaker_website ' , true ) ? '<span class="dashicons dashicons-yes-alt" style="color:green"></span> ' : '<span class="dashicons dashicons-no-alt" style="color:red"></span> ' ;
393
+ break ;
394
+ }
395
+ }
396
+
397
+ /**
398
+ * Add custom column header to lfe_speaker admin display.
399
+ *
400
+ * @param array $columns Column headers.
401
+ */
402
+ public function speaker_custom_column ( $ columns ) {
403
+ // take default columns.
404
+ $ date = $ columns ['date ' ];
405
+ $ author = $ columns ['author ' ];
406
+ // unset so we can move it.
407
+ unset( $ columns ['date ' ] );
408
+ unset( $ columns ['author ' ] );
409
+ // add new columns.
410
+ $ columns ['title_company ' ] = 'Title, Company ' ;
411
+ $ columns ['linkedin_url ' ] = 'Linkedin URL ' ;
412
+ $ columns ['twitter_url ' ] = 'Twitter URL ' ;
413
+ $ columns ['website_url ' ] = 'Websiter URL ' ;
414
+ // add back in old columns.
415
+ $ columns ['author ' ] = $ author ;
416
+ $ columns ['date ' ] = $ date ;
417
+ return $ columns ;
418
+ }
419
+
420
+ /**
421
+ * Add custom column data to lfe_sponsor admin display.
422
+ *
423
+ * @param string $column The column.
424
+ * @param int $post_id The post.
425
+ * @return void
426
+ */
427
+ public function sponsor_custom_column_data ( $ column , $ post_id ) {
428
+ switch ( $ column ) {
429
+ case 'sponsor_logo ' :
430
+ echo has_post_thumbnail ($ post_id ) ? '<span class="dashicons dashicons-yes-alt" style="color:green"></span> ' : '<span class="dashicons dashicons-no-alt" style="color:red"></span> ' ;
431
+ break ;
432
+ case 'forwarding_url ' :
433
+ echo get_post_meta ( $ post_id , 'lfe_sponsor_url ' , true ) ? get_post_meta ( $ post_id , 'lfe_sponsor_url ' , true ) : "- " ;
434
+ break ;
435
+ case 'alt_text ' :
436
+ echo get_post_meta ( $ post_id , 'lfe_sponsor_alt_text ' , true ) ? get_post_meta ( $ post_id , 'lfe_sponsor_alt_text ' , true ) : "- " ;
437
+ break ;
438
+ }
439
+ }
440
+
441
+ /**
442
+ * Add custom column header to lfe_sponsor admin display.
443
+ *
444
+ * @param array $columns Column headers.
445
+ */
446
+ public function sponsor_custom_column ( $ columns ) {
447
+ // take default columns.
448
+ $ date = $ columns ['date ' ];
449
+ $ author = $ columns ['author ' ];
450
+ // unset so we can move it.
451
+ unset( $ columns ['date ' ] );
452
+ unset( $ columns ['author ' ] );
453
+ // add new columns.
454
+ $ columns ['sponsor_logo ' ] = 'Sponsor Logo ' ;
455
+ $ columns ['forwarding_url ' ] = 'Forwarding URL ' ;
456
+ $ columns ['alt_text ' ] = 'Alt text ' ;
457
+ // add back in old columns.
458
+ $ columns ['author ' ] = $ author ;
459
+ $ columns ['date ' ] = $ date ;
460
+ return $ columns ;
461
+ }
462
+
373
463
/**
374
464
* Remove tags support from posts
375
465
*/
0 commit comments