Advertisement
Guest User

event espresso

a guest
May 25th, 2015
288
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.24 KB | None | 0 0
  1. <?php
  2. /**
  3. * Requires (pulls in) the initializing functions of Dynamik
  4. * which are found in the /lib/init.php file.
  5. *
  6. * @package Dynamik
  7. */
  8.  
  9. /**
  10. * Include Genesis theme files
  11. */
  12. require_once( get_template_directory() . '/lib/init.php' );
  13.  
  14. /**
  15. * Include Dynamik theme files
  16. */
  17. require_once( get_stylesheet_directory() . '/lib/init.php' );
  18.  
  19. add_action( 'admin_bar_menu', 'wp_admin_bar_my_custom_account_menu', 11 );
  20.  
  21. function wp_admin_bar_my_custom_account_menu( $wp_admin_bar ) {
  22. $user_id = get_current_user_id();
  23. $current_user = wp_get_current_user();
  24. $profile_url = get_edit_profile_url( $user_id );
  25.  
  26.  
  27. if ( 0 != $user_id ) {
  28. /* Add the "My Account" menu */
  29. $avatar = get_avatar( $user_id, 28 );
  30. $howdy = sprintf( __('Welkom, %1$s u kunt hier uitloggen'), $current_user->display_name );
  31. $class = empty( $avatar ) ? '' : 'with-avatar';
  32.  
  33. $wp_admin_bar->add_menu( array(
  34. 'id' => 'my-account',
  35. 'parent' => 'top-secondary',
  36. 'title' => $howdy . $avatar,
  37. 'href' => $profile_url,
  38. 'meta' => array(
  39. 'class' => $class,
  40. ),
  41. ) );
  42.  
  43. }
  44. }
  45.  
  46. add_filter ('the_content', 'my_remove_event_datetimes', 100 );
  47.  
  48. // remove datetimes
  49. function my_remove_event_datetimes( $content ) {
  50. if ( 'espresso_events' == get_post_type() && is_singular() && !post_password_required() ) {
  51. remove_filter( 'the_content', array( 'EED_Event_Single', 'event_datetimes' ), 110 );
  52. add_filter( 'the_content', 'my_add_event_datetimes', 122);
  53. }
  54. return $content;
  55. }
  56.  
  57. // add datetimes after the tickets
  58. function my_add_event_datetimes( $content ) {
  59. return $content . EEH_Template::locate_template( 'content-espresso_events-datetimes.php' );
  60. }
  61.  
  62. add_filter ('the_content', 'my_remove_event_tickets', 100 );
  63.  
  64. // remove tickets
  65. function my_remove_event_tickets( $content ) {
  66. if ( 'espresso_events' == get_post_type() && is_singular() && !post_password_required() ) {
  67. remove_filter( 'the_content', array( 'EED_Event_Single', 'event_tickets' ), 120 );
  68. add_filter( 'the_content', 'my_add_event_tickets', 121);
  69. }
  70. return $content;
  71. }
  72.  
  73. // add tickets after the content
  74. function my_add_event_tickets( $content ) {
  75. return $content . EEH_Template::locate_template( 'content-espresso_events-tickets.php' );
  76. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement