WordPress.org

Make WordPress Core

Ticket #9657: 9657-plugin.php

File 9657-plugin.php, 1.8 KB (added by hakre, 5 years ago)

Minor Testplugin update (Naming)

Line 
1<?php
2/*
3Plugin Name: #9657 Extra Metas
4Plugin URI: http://core.trac.wordpress.org/ticket/9657
5Description: Extra Meta Links Test Plugin. Activate to add an additional Meta Links for testing. Needs a patched template.php to work.
6Version: 0.2.1
7Author: hakre
8Author URI: http://codex.wordpress.org/User:Hakre
9*/
10/*  Copyright 2009 by the authors
11
12    This program is free software; you can redistribute it and/or modify
13    it under the terms of the GNU General Public License as published by
14    the Free Software Foundation; either version 2 of the License, or
15    (at your option) any later version.
16
17    This program is distributed in the hope that it will be useful,
18    but WITHOUT ANY WARRANTY; without even the implied warranty of
19    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20    GNU General Public License for more details.
21
22    You should have received a copy of the GNU General Public License
23    along with this program; if not, write to the Free Software
24    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
25*/
26
27/**
28 * extra-metas plugin class
29 *
30 */
31class pluginExtraMetas
32{
33        /**
34         * constructor
35         *
36         * @return this
37         */
38        function pluginExtraMetas() {
39                // Add Hook for adding extra meta links
40                add_filter('screen_meta_extra_metas', array($this, 'screen_meta_extra_metas'), 10, 2);         
41        }       
42       
43       
44        /**
45         * screen_meta_extra_metas hook function
46         *
47         * @param  array  $extra_metas extra meta links array
48         * @param  string $screen      current screen
49         * @return array  filtered extra meta links array
50         */
51        function screen_meta_extra_metas($extra_metas, $screen)
52        {
53                // sample everwhere additional link
54                $extra_metas[] = array(__('Extra Meta Test'), '<h5>Test Content</h5><div>This is an Extra Meta Test content</div>');
55               
56                return $extra_metas;
57        }
58}
59
60$oExtraMetas = new pluginExtraMetas();