Advertisement
Guest User

Untitled

a guest
Dec 4th, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. <?php
  2. /*
  3. Plugin Name: Have an Ardbeg
  4. Description: Adds custom separator between title and shorturl in the Share Box
  5. Version: 0.1
  6. Author: Ozh
  7. */
  8.  
  9.  
  10. // Edit this if needed
  11. define('ARDBEG_SEPARATOR',' | ');
  12.  
  13. yourls_add_filter('share_box_data', 'ardbeg_add_char_to_share_box_title_when_bookmarklet');
  14. yourls_add_filter('table_add_row_cell_array', 'ardbeg_add_char_to_share_box_title_when_admin_interface');
  15.  
  16. // Function called when you're echoing result from a bookmarklet
  17. function ardbeg_add_char_to_share_box_title_when_bookmarklet($in){
  18. $in['share'] = $in['title'] . ARDBEG_SEPARATOR . $in['shorturl'];
  19. return $in;
  20. }
  21.  
  22. // Function called otherwise
  23. function ardbeg_add_char_to_share_box_title_when_admin_interface($in){
  24. $in['url']['title_attr'] = $in['url']['title_attr'] . yourls_esc_attr(ARDBEG_SEPARATOR);
  25. return $in;
  26. }
  27.  
  28. // Swear you never put ice in your whishky
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement