Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.66 KB | None | 0 0
  1. /**
  2. * Display staff member info meta box.
  3. *
  4. * @since 1.17
  5. */
  6. public function staff_member_info_meta_box() {
  7.  
  8. global $post;
  9.  
  10. $custom = get_post_custom( $post->ID );
  11. $_staff_member_title = isset( $custom['_staff_member_title'][0] ) ? $custom['_staff_member_title'][0] : '';
  12. $_staff_member_email = isset( $custom['_staff_member_email'][0] ) ? $custom['_staff_member_email'][0] : '';
  13. $_staff_member_phone = isset( $custom['_staff_member_phone'][0] ) ? $custom['_staff_member_phone'][0] : '';
  14. $_staff_member_fb = isset( $custom['_staff_member_fb'][0] ) ? $custom['_staff_member_fb'][0] : '';
  15. $_staff_member_tw = isset( $custom['_staff_member_tw'][0] ) ? $custom['_staff_member_tw'][0] : '';
  16. ?>
  17.  
  18. <div class="sslp_admin_wrap">
  19. <label for="_staff-member-title">
  20. <?php esc_html_e( 'Position:', $this->plugin_name ); ?>
  21. <input type="text"
  22. name="_staff_member_title"
  23. id="_staff_member_title"
  24. placeholder="<?php esc_attr_e( 'Staff Member\'s Position', $this->plugin_name ); ?>"
  25. value="<?php echo esc_attr( $_staff_member_title ); ?>"/>
  26. </label>
  27. <label for="_staff-member-email">
  28. <?php esc_html_e( 'Email:', $this->plugin_name ); ?>
  29. <input type="text"
  30. name="_staff_member_email"
  31. id="_staff_member_email"
  32. placeholder="<?php esc_attr_e( 'Staff Member\'s Email', $this->plugin_name ); ?>"
  33. value="<?php echo esc_attr( $_staff_member_email ); ?>"/>
  34. </label>
  35. <label for="_staff-member-title">
  36. <?php esc_html_e( 'Phone:', $this->plugin_name ); ?>
  37. <input type="text"
  38. name="_staff_member_phone"
  39. id="_staff_member_phone"
  40. placeholder="<?php esc_attr_e( 'Staff Member\'s Phone', $this->plugin_name ); ?>"
  41. value="<?php echo esc_attr( $_staff_member_phone ); ?>"/>
  42. </label>
  43. <label for="_staff-member-fb">
  44. <?php esc_html_e( 'Facebook URL:', $this->plugin_name ); ?>
  45. <input type="text"
  46. name="_staff_member_fb"
  47. id="_staff_member_fb"
  48. placeholder="<?php esc_attr_e( 'Staff Member\'s Facebook URL', $this->plugin_name ); ?>"
  49. value="<?php echo esc_attr( $_staff_member_fb ); ?>"/>
  50. </label>
  51. <label for="_staff-member-tw">
  52. <?php esc_html_e( 'Twitter Username:', $this->plugin_name ); ?>
  53. <input type="text"
  54. name="_staff_member_tw"
  55. id="_staff_member_tw"
  56. placeholder="<?php esc_attr_e( 'Staff Member\'s Twitter Name', $this->plugin_name ); ?>"
  57. value="<?php echo esc_attr( $_staff_member_tw ); ?>"/>
  58. </label>
  59. </div>
  60. <?php
  61.  
  62. }
  63.  
  64. /**
  65. * Display staff member warnings.
  66. *
  67. * @since 1.17
  68. */
  69. public function sslp_staff_member_warning_meta_box() {
  70.  
  71. esc_html_e(
  72. '<p><strong>Your current theme does not support post thumbnails. Unfortunately, you will not be able to add photos for your Staff Members</strong></p>',
  73. $this->plugin_name
  74. );
  75.  
  76. }
  77.  
  78. /**
  79. * Display staff member bio meta box.
  80. *
  81. * @since 1.17
  82. */
  83. public function staff_member_bio_meta_box() {
  84.  
  85. global $post;
  86.  
  87. $custom = get_post_custom( $post->ID );
  88. $_staff_member_bio = isset( $custom['_staff_member_bio'][0] ) ? $custom['_staff_member_bio'][0] : '';
  89.  
  90. wp_editor(
  91. $_staff_member_bio,
  92. '_staff_member_bio',
  93. $settings = array(
  94. 'textarea_rows' => 8,
  95. 'media_buttons' => false,
  96. 'tinymce' => true, // Disables actual TinyMCE buttons // This makes the rich content editor.
  97. 'quicktags' => true, // Use QuickTags for formatting // work within a metabox.
  98. )
  99. );
  100. ?>
  101.  
  102. <p class="sslp-note">**Note: HTML is allowed.</p>
  103.  
  104. <?php wp_nonce_field( 'sslp_post_nonce', 'sslp_add_edit_staff_member_noncename' ); ?>
  105.  
  106. <?php
  107.  
  108. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement