1 | <?php |
---|
2 | /* |
---|
3 | * Plugin Name: 24724 bug demo |
---|
4 | * Author URI: http://www.1nterval.com |
---|
5 | * Description: Demo for the bug recorded in 24724 track ticket |
---|
6 | * Author: Fabien Quatravaux |
---|
7 | * Version: 1.0 |
---|
8 | */ |
---|
9 | |
---|
10 | // enqueue media editor files on the frontend |
---|
11 | add_action('wp_enqueue_scripts', 'bugdemo_enqueue_media'); |
---|
12 | function bugdemo_enqueue_media(){ |
---|
13 | if(is_user_logged_in()) wp_enqueue_media(); |
---|
14 | } |
---|
15 | |
---|
16 | // remove the admin bar |
---|
17 | add_filter( 'show_admin_bar', '__return_false' ); |
---|
18 | |
---|
19 | // add a link to the trac ticket in plugin links |
---|
20 | add_filter('plugin_action_links', 'bugdemo_track_link', 10, 2); |
---|
21 | function bugdemo_track_link($links, $file){ |
---|
22 | if ($file == plugin_basename(__FILE__)) { |
---|
23 | array_unshift($links, '<a href="http://core.trac.wordpress.org/ticket/24724">View ticket on trac</a>'); |
---|
24 | } |
---|
25 | return $links; |
---|
26 | } |
---|