Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- Plugin Name: Have an Ardbeg
- Description: Adds custom separator between title and shorturl in the Share Box
- Version: 0.1
- Author: Ozh
- */
- // Edit this if needed
- define('ARDBEG_SEPARATOR',' | ');
- yourls_add_filter('share_box_data', 'ardbeg_add_char_to_share_box_title_when_bookmarklet');
- yourls_add_filter('table_add_row_cell_array', 'ardbeg_add_char_to_share_box_title_when_admin_interface');
- // Function called when you're echoing result from a bookmarklet
- function ardbeg_add_char_to_share_box_title_when_bookmarklet($in){
- $in['share'] = $in['title'] . ARDBEG_SEPARATOR . $in['shorturl'];
- return $in;
- }
- // Function called otherwise
- function ardbeg_add_char_to_share_box_title_when_admin_interface($in){
- $in['url']['title_attr'] = $in['url']['title_attr'] . yourls_esc_attr(ARDBEG_SEPARATOR);
- return $in;
- }
- // Swear you never put ice in your whishky
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement