Advertisement
Guest User

Untitled

a guest
Oct 24th, 2015
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.46 KB | None | 0 0
  1. <?php
  2. /**
  3. * @package Boss Child Theme
  4. * The parent theme functions are located at /boss/buddyboss-inc/theme-functions.php
  5. * Add your own functions in this file.
  6. */
  7.  
  8. /**
  9. * Sets up theme defaults
  10. *
  11. * @since Boss Child Theme 1.0.0
  12. */
  13. function boss_child_theme_setup()
  14. {
  15. /**
  16. * Makes child theme available for translation.
  17. * Translations can be added into the /languages/ directory.
  18. * Read more at: http://www.buddyboss.com/tutorials/language-translations/
  19. */
  20.  
  21. // Translate text from the PARENT theme.
  22. load_theme_textdomain( 'boss', get_stylesheet_directory() . '/languages' );
  23.  
  24. // Translate text from the CHILD theme only.
  25. // Change 'boss' instances in all child theme files to 'boss_child_theme'.
  26. // load_theme_textdomain( 'boss_child_theme', get_stylesheet_directory() . '/languages' );
  27.  
  28. }
  29. add_action( 'after_setup_theme', 'boss_child_theme_setup' );
  30.  
  31. /**
  32. * Enqueues scripts and styles for child theme front-end.
  33. *
  34. * @since Boss Child Theme 1.0.0
  35. */
  36. function boss_child_theme_scripts_styles()
  37. {
  38. /**
  39. * Scripts and Styles loaded by the parent theme can be unloaded if needed
  40. * using wp_deregister_script or wp_deregister_style.
  41. *
  42. * See the WordPress Codex for more information about those functions:
  43. * http://codex.wordpress.org/Function_Reference/wp_deregister_script
  44. * http://codex.wordpress.org/Function_Reference/wp_deregister_style
  45. **/
  46.  
  47. /*
  48. * Styles
  49. */
  50. wp_enqueue_style( 'boss-child-custom', get_stylesheet_directory_uri().'/css/custom.css' );
  51. }
  52. add_action( 'wp_enqueue_scripts', 'boss_child_theme_scripts_styles', 9999 );
  53.  
  54.  
  55. /****************************** CUSTOM FUNCTIONS ******************************/
  56.  
  57. // Add your own custom functions here
  58. // JOHAN: DETTA GÖR ATT FULLSTÄNDIGT NAMN VISAS UNDER TITELN NÄR ANVÄNDER MEDIAPRESS WIDGETS
  59.  
  60.  
  61. add_action( 'mpp_after_media_widget_item', 'mpp_custom_add_user_link' );
  62. function mpp_custom_add_user_link() {
  63. //you may put some conditions here like
  64.  
  65. //mpp_is_single_gallery();
  66. //mpp_is_single_media();
  67. //to avoid showing it on single gallery/media pages
  68.  
  69. $user_id = mpp_get_media_creator_id();
  70. $link = sprintf( "<a href='%s'>%s</a>", bp_core_get_user_domain( $user_id ), bp_core_get_username( $user_id ) );
  71. echo $link;
  72. }
  73.  
  74.  
  75. // JOHAN: DETTA GÖR ATT ANVÄNDARNAMNEN VISAS UNDER TITELN NÄR ANVÄNDER MEDIAPRESS SHORTCODES
  76.  
  77. add_action( 'mpp_after_media_shortcode_item', 'mpp_custom_add_user_link' );
  78.  
  79.  
  80. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement