PluginProbe
Catch IDs / 1.2.2
Catch IDs v1.2.2
2.7.3 2.8 2.8.1 3.0 trunk 1.0 1.1 1.2 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.3 1.4 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.4.8 1.5 All 39 releases
catch-ids / catch-ids.php

catch-ids.php in Catch IDs 1.2.2, at catch-ids.php

129 lines 3.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /*
3 Plugin Name: Catch IDs
4 Plugin URI: http://catchthemes.com/wp-plugins/catch-ids/
5 Description: Catch IDs is a simple and light weight plugin to show the Post ID, Page ID, Media ID, Links ID, Category ID, Tag ID and User ID in the Admin Section Table. This plugin was initially develop to support our themes features slider. Then we thought that this will be helpful to all the WordPress Admin Users. Just activate and catch IDs in your page, post, category, tag and media pages.
6 Version: 1.2.2
7 License: GNU General Public License, version 3 (GPLv3)
8 License URI: http://www.gnu.org/licenses/gpl-3.0.txt
9 Author: Catch Themes Team
10 Author URI: http://catchthemes.com
11 Tags: admin, catch-ids, category, ids, links, media, page, post, show, simple, tag, user, wp-admin
12 */
13
14 /*
15 Copyright (C) 2012 -2014 Catch Themes, (info@catchthemes.com)
16
17 This program is free software; you can redistribute it and/or modify
18 it under the terms of the GNU General Public License as published by
19 the Free Software Foundation; either version 3 of the License, or
20 (at your option) any later version.
21
22 This program is distributed in the hope that it will be useful,
23 but WITHOUT ANY WARRANTY; without even the implied warranty of
24 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 GNU General Public License for more details.
26
27 You should have received a copy of the GNU General Public License
28 along with this program. If not, see <http://www.gnu.org/licenses/>.
29 */
30
31
32 /**
33 * @package Catch Themes
34 * @subpackage Catch IDs
35 * @since Catch IDs 1.0
36 */
37
38
39 if ( ! function_exists( 'catchids_column' ) ):
40 /**
41 * Prepend the new column to the columns array
42 */
43 function catchids_column($cols) {
44 $cols['catchids'] = 'ID';
45 return $cols;
46 }
47 endif; // catchids_column
48
49
50 if ( ! function_exists( 'catchids_value' ) ) :
51 /**
52 * Echo the ID for the new column
53 */
54 function catchids_value( $column_name, $id ) {
55 if ( $column_name == 'catchids' )
56 echo $id;
57 }
58 endif; // catchids_value
59
60
61 if ( ! function_exists( 'catchids_return_value' ) ) :
62 function catchids_return_value( $value, $column_name, $id ) {
63 if ( $column_name == 'catchids' )
64 $value = $id;
65 return $value;
66 }
67 endif; // catchids_return_value
68
69
70 if ( ! function_exists( 'catchids_css' ) ) :
71 /**
72 * Output CSS for width of new column
73 */
74 function catchids_css() {
75 ?>
76 <style type="text/css">
77 #catchids {
78 width: 50px;
79 }
80 </style>
81 <?php
82 }
83 endif; // catchids_css
84
85
86 if ( ! function_exists( 'catchids_add' ) ) :
87 /**
88 * Actions/Filters for various tables and the css output
89 */
90 function catchids_add() {
91 add_action( 'admin_head', 'catchids_css');
92
93 // For Post Management
94 add_filter( 'manage_posts_columns', 'catchids_column' );
95 add_action( 'manage_posts_custom_column', 'catchids_value', 10, 2 );
96
97 // For Page Management
98 add_filter( 'manage_pages_columns', 'catchids_column' );
99 add_action( 'manage_pages_custom_column', 'catchids_value', 10, 2 );
100
101 // For Media Management
102 add_filter( 'manage_media_columns', 'catchids_column' );
103 add_action( 'manage_media_custom_column', 'catchids_value', 10, 2 );
104
105 // For Link Management
106 add_filter( 'manage_link-manager_columns', 'catchids_column' );
107 add_action( 'manage_link_custom_column', 'catchids_value', 10, 2 );
108
109 // For Category Management
110 add_action( 'manage_edit-link-categories_columns', 'catchids_column' );
111 add_filter( 'manage_link_categories_custom_column', 'catchids_return_value', 10, 3 );
112
113 // For Tags Management
114 foreach ( get_taxonomies() as $taxonomy ) {
115 add_action("manage_edit-${taxonomy}_columns", 'catchids_column');
116 add_filter("manage_${taxonomy}_custom_column", 'catchids_return_value', 10, 3);
117 }
118
119 // For User Management
120 add_action( 'manage_users_columns', 'catchids_column' );
121 add_filter( 'manage_users_custom_column', 'catchids_return_value', 10, 3 );
122
123 // For Comment Management
124 add_action( 'manage_edit-comments_columns', 'catchids_column' );
125 add_action( 'manage_comments_custom_column', 'catchids_value', 10, 2 );
126 }
127 endif; // catchids_add
128
129 add_action( 'admin_init', 'catchids_add' );