Make WordPress Core

Ticket #24724: 24724_demo.php

File 24724_demo.php, 801 bytes (added by Fab1en, 12 years ago)

Basic plugin that show the issue

Line 
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
11add_action('wp_enqueue_scripts', 'bugdemo_enqueue_media');
12function bugdemo_enqueue_media(){
13    if(is_user_logged_in()) wp_enqueue_media();
14}
15
16// remove the admin bar
17add_filter( 'show_admin_bar', '__return_false' );
18
19// add a link to the trac ticket in plugin links
20add_filter('plugin_action_links', 'bugdemo_track_link', 10, 2);
21function 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}