Version Description
- Framework updated; general cleanup.
- Updated with static class methods. This plugin now uses PHP's SPL autoload functionality to further optimize all of its routines.
- Optimizations. Further internal optimizations applied through configuration checksums.
Download this release
Release Info
| Developer | PriMoThemes |
| Plugin | |
| Version | 1.2 |
| Comparing to | |
| See all releases | |
Code changes from version 1.0.6 to 1.2
- includes/classes/columns.inc.php +74 -0
- includes/classes/handlers.inc.php +55 -0
- includes/classes/index.php +0 -0
- includes/classes/installation.inc.php +45 -0
- includes/classes/utilities.inc.php +33 -0
- includes/funcs.inc.php +1 -1
- includes/functions/activate-deactivate.inc.php +0 -48
- includes/functions/class-autoloader.inc.php +60 -0
- includes/functions/column-handlers.inc.php +0 -61
- includes/functions/configure-columns.inc.php +0 -68
- includes/functions/deprecated.inc.php +29 -0
- includes/hooks.inc.php +7 -2
- includes/syscon.inc.php +3 -3
- readme.txt +8 -3
- wp-show-ids.php +4 -4
includes/classes/columns.inc.php
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/*
|
| 3 |
+
Copyright: © 2009 WebSharks, Inc. ( coded in the USA )
|
| 4 |
+
<mailto:support@websharks-inc.com> <http://www.websharks-inc.com/>
|
| 5 |
+
|
| 6 |
+
Released under the terms of the GNU General Public License.
|
| 7 |
+
You should have received a copy of the GNU General Public License,
|
| 8 |
+
along with this software. In the main directory, see: /licensing/
|
| 9 |
+
If not, see: <http://www.gnu.org/licenses/>.
|
| 10 |
+
*/
|
| 11 |
+
/*
|
| 12 |
+
Direct access denial.
|
| 13 |
+
*/
|
| 14 |
+
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
| 15 |
+
exit ("Do not access this file directly.");
|
| 16 |
+
/**/
|
| 17 |
+
if (!class_exists ("c_ws_plugin__wp_show_ids_columns"))
|
| 18 |
+
{
|
| 19 |
+
class c_ws_plugin__wp_show_ids_columns
|
| 20 |
+
{
|
| 21 |
+
/*
|
| 22 |
+
Configure all of the required Hooks/Filters for columns & css.
|
| 23 |
+
Attach to: add_action("admin_init");
|
| 24 |
+
*/
|
| 25 |
+
public static function configure ()
|
| 26 |
+
{
|
| 27 |
+
global $wp_post_types, $wp_taxonomies; /* Grab global references. */
|
| 28 |
+
/**/
|
| 29 |
+
do_action ("ws_plugin__wp_show_ids_before_configure", get_defined_vars ());
|
| 30 |
+
/**/
|
| 31 |
+
add_action ("admin_head", "c_ws_plugin__wp_show_ids_handlers::echo_css");
|
| 32 |
+
/**/
|
| 33 |
+
add_filter ("manage_edit-post_columns", "c_ws_plugin__wp_show_ids_handlers::return_column");
|
| 34 |
+
add_action ("manage_posts_custom_column", "c_ws_plugin__wp_show_ids_handlers::echo_value", 10, 2);
|
| 35 |
+
/**/
|
| 36 |
+
add_filter ("manage_edit-comments_columns", "c_ws_plugin__wp_show_ids_handlers::return_column");
|
| 37 |
+
add_action ("manage_comments_custom_column", "c_ws_plugin__wp_show_ids_handlers::echo_value", 10, 2);
|
| 38 |
+
/**/
|
| 39 |
+
add_filter ("manage_edit-page_columns", "c_ws_plugin__wp_show_ids_handlers::return_column");
|
| 40 |
+
add_action ("manage_pages_custom_column", "c_ws_plugin__wp_show_ids_handlers::echo_value", 10, 2);
|
| 41 |
+
/**/
|
| 42 |
+
add_filter ("manage_link-manager_columns", "c_ws_plugin__wp_show_ids_handlers::return_column");
|
| 43 |
+
add_action ("manage_link_custom_column", "c_ws_plugin__wp_show_ids_handlers::echo_value", 10, 2);
|
| 44 |
+
/**/
|
| 45 |
+
add_filter ("manage_edit-link-categories_columns", "c_ws_plugin__wp_show_ids_handlers::return_column");
|
| 46 |
+
add_filter ("manage_link_categories_custom_column", "c_ws_plugin__wp_show_ids_handlers::return_value", 10, 3);
|
| 47 |
+
/**/
|
| 48 |
+
add_filter ("manage_upload_columns", "c_ws_plugin__wp_show_ids_handlers::return_column");
|
| 49 |
+
add_action ("manage_media_custom_column", "c_ws_plugin__wp_show_ids_handlers::echo_value", 10, 2);
|
| 50 |
+
/**/
|
| 51 |
+
add_filter ("manage_users_columns", "c_ws_plugin__wp_show_ids_handlers::return_column");
|
| 52 |
+
add_filter ("manage_users_custom_column", "c_ws_plugin__wp_show_ids_handlers::return_value", 10, 3);
|
| 53 |
+
/**/
|
| 54 |
+
if (is_array ($wp_post_types))
|
| 55 |
+
foreach ($wp_post_types as $type => $post_type_object) /* Handle WP 3.0+ Post Types. */
|
| 56 |
+
{
|
| 57 |
+
add_action ("manage_edit-${type}_columns", "c_ws_plugin__wp_show_ids_handlers::return_column");
|
| 58 |
+
add_filter ("manage_${type}_custom_column", "c_ws_plugin__wp_show_ids_handlers::return_value", 10, 3);
|
| 59 |
+
}
|
| 60 |
+
/**/
|
| 61 |
+
if (is_array ($wp_taxonomies))
|
| 62 |
+
foreach ($wp_taxonomies as $taxonomy => $taxonomy_o) /* Handle WP 3.0+ Taxonomies. */
|
| 63 |
+
{
|
| 64 |
+
add_action ("manage_edit-${taxonomy}_columns", "c_ws_plugin__wp_show_ids_handlers::return_column");
|
| 65 |
+
add_filter ("manage_${taxonomy}_custom_column", "c_ws_plugin__wp_show_ids_handlers::return_value", 10, 3);
|
| 66 |
+
}
|
| 67 |
+
/**/
|
| 68 |
+
do_action ("ws_plugin__wp_show_ids_after_configure", get_defined_vars ());
|
| 69 |
+
/**/
|
| 70 |
+
return; /* Return for uniformity. */
|
| 71 |
+
}
|
| 72 |
+
}
|
| 73 |
+
}
|
| 74 |
+
?>
|
includes/classes/handlers.inc.php
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/*
|
| 3 |
+
Copyright: © 2009 WebSharks, Inc. ( coded in the USA )
|
| 4 |
+
<mailto:support@websharks-inc.com> <http://www.websharks-inc.com/>
|
| 5 |
+
|
| 6 |
+
Released under the terms of the GNU General Public License.
|
| 7 |
+
You should have received a copy of the GNU General Public License,
|
| 8 |
+
along with this software. In the main directory, see: /licensing/
|
| 9 |
+
If not, see: <http://www.gnu.org/licenses/>.
|
| 10 |
+
*/
|
| 11 |
+
/*
|
| 12 |
+
Direct access denial.
|
| 13 |
+
*/
|
| 14 |
+
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
| 15 |
+
exit ("Do not access this file directly.");
|
| 16 |
+
/**/
|
| 17 |
+
if (!class_exists ("c_ws_plugin__wp_show_ids_handlers"))
|
| 18 |
+
{
|
| 19 |
+
class c_ws_plugin__wp_show_ids_handlers
|
| 20 |
+
{
|
| 21 |
+
/*
|
| 22 |
+
Echo the wp_show_ids column css for width.
|
| 23 |
+
*/
|
| 24 |
+
public static function echo_css () /* Includes column headers too. */
|
| 25 |
+
{
|
| 26 |
+
$css = '<style type="text/css">';
|
| 27 |
+
$css .= 'th.column-ws_plugin__wp_show_ids, td.column-ws_plugin__wp_show_ids { width:45px; text-align:center; }';
|
| 28 |
+
$css .= '</style>';
|
| 29 |
+
/**/
|
| 30 |
+
echo apply_filters ("ws_plugin__wp_show_ids_echo_css", $css, get_defined_vars ());
|
| 31 |
+
}
|
| 32 |
+
/*
|
| 33 |
+
Add the wp_show_ids column.
|
| 34 |
+
*/
|
| 35 |
+
public static function return_column ($cols = FALSE)
|
| 36 |
+
{
|
| 37 |
+
return apply_filters ("ws_plugin__wp_show_ids_return_column", array_merge ($cols, array ("ws_plugin__wp_show_ids" => "ID")), get_defined_vars ());
|
| 38 |
+
}
|
| 39 |
+
/*
|
| 40 |
+
Return the wp_show_ids column value.
|
| 41 |
+
*/
|
| 42 |
+
public static function return_value ($value = FALSE, $column_name = FALSE, $id = FALSE)
|
| 43 |
+
{
|
| 44 |
+
return apply_filters ("ws_plugin__wp_show_ids_return_value", ( ($column_name === "ws_plugin__wp_show_ids") ? $id : $value), get_defined_vars ());
|
| 45 |
+
}
|
| 46 |
+
/*
|
| 47 |
+
Echo the wp_show_ids column value.
|
| 48 |
+
*/
|
| 49 |
+
public static function echo_value ($column_name = FALSE, $id = FALSE)
|
| 50 |
+
{
|
| 51 |
+
echo apply_filters ("ws_plugin__wp_show_ids_echo_value", ( ($column_name === "ws_plugin__wp_show_ids") ? $id : null), get_defined_vars ());
|
| 52 |
+
}
|
| 53 |
+
}
|
| 54 |
+
}
|
| 55 |
+
?>
|
includes/classes/index.php
ADDED
|
File without changes
|
includes/classes/installation.inc.php
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/*
|
| 3 |
+
Copyright: © 2009 WebSharks, Inc. ( coded in the USA )
|
| 4 |
+
<mailto:support@websharks-inc.com> <http://www.websharks-inc.com/>
|
| 5 |
+
|
| 6 |
+
Released under the terms of the GNU General Public License.
|
| 7 |
+
You should have received a copy of the GNU General Public License,
|
| 8 |
+
along with this software. In the main directory, see: /licensing/
|
| 9 |
+
If not, see: <http://www.gnu.org/licenses/>.
|
| 10 |
+
*/
|
| 11 |
+
/*
|
| 12 |
+
Direct access denial.
|
| 13 |
+
*/
|
| 14 |
+
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
| 15 |
+
exit ("Do not access this file directly.");
|
| 16 |
+
/**/
|
| 17 |
+
if (!class_exists ("c_ws_plugin__wp_show_ids_installation"))
|
| 18 |
+
{
|
| 19 |
+
class c_ws_plugin__wp_show_ids_installation
|
| 20 |
+
{
|
| 21 |
+
/*
|
| 22 |
+
Handles activation routines.
|
| 23 |
+
*/
|
| 24 |
+
public static function activate ()
|
| 25 |
+
{
|
| 26 |
+
do_action ("ws_plugin__wp_show_ids_before_activation", get_defined_vars ());
|
| 27 |
+
/**/
|
| 28 |
+
do_action ("ws_plugin__wp_show_ids_after_activation", get_defined_vars ());
|
| 29 |
+
/**/
|
| 30 |
+
return; /* Return for uniformity. */
|
| 31 |
+
}
|
| 32 |
+
/*
|
| 33 |
+
Handles de-activation / cleanup routines.
|
| 34 |
+
*/
|
| 35 |
+
public static function deactivate ()
|
| 36 |
+
{
|
| 37 |
+
do_action ("ws_plugin__wp_show_ids_before_deactivation", get_defined_vars ());
|
| 38 |
+
/**/
|
| 39 |
+
do_action ("ws_plugin__wp_show_ids_after_deactivation", get_defined_vars ());
|
| 40 |
+
/**/
|
| 41 |
+
return; /* Return for uniformity. */
|
| 42 |
+
}
|
| 43 |
+
}
|
| 44 |
+
}
|
| 45 |
+
?>
|
includes/classes/utilities.inc.php
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/*
|
| 3 |
+
Copyright: © 2009 WebSharks, Inc. ( coded in the USA )
|
| 4 |
+
<mailto:support@websharks-inc.com> <http://www.websharks-inc.com/>
|
| 5 |
+
|
| 6 |
+
Released under the terms of the GNU General Public License.
|
| 7 |
+
You should have received a copy of the GNU General Public License,
|
| 8 |
+
along with this software. In the main directory, see: /licensing/
|
| 9 |
+
If not, see: <http://www.gnu.org/licenses/>.
|
| 10 |
+
*/
|
| 11 |
+
/*
|
| 12 |
+
Direct access denial.
|
| 13 |
+
*/
|
| 14 |
+
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
| 15 |
+
exit ("Do not access this file directly.");
|
| 16 |
+
/**/
|
| 17 |
+
if (!class_exists ("c_ws_plugin__wp_show_ids_utilities"))
|
| 18 |
+
{
|
| 19 |
+
class c_ws_plugin__wp_show_ids_utilities
|
| 20 |
+
{
|
| 21 |
+
/*
|
| 22 |
+
Function builds a version checksum for this installation.
|
| 23 |
+
*/
|
| 24 |
+
public static function ver_checksum ()
|
| 25 |
+
{
|
| 26 |
+
$checksum = WS_PLUGIN__WP_SHOW_IDS_VERSION; /* Software version string. */
|
| 27 |
+
$checksum .= "-" . abs (crc32 ($GLOBALS["WS_PLUGIN__"]["wp_show_ids"]["c"]["checksum"]));
|
| 28 |
+
/**/
|
| 29 |
+
return $checksum; /* ( i.e. version-checksum ) */
|
| 30 |
+
}
|
| 31 |
+
}
|
| 32 |
+
}
|
| 33 |
+
?>
|
includes/funcs.inc.php
CHANGED
|
@@ -18,7 +18,7 @@ Include all of the functions that came with this plugin.
|
|
| 18 |
*/
|
| 19 |
if (is_dir ($ws_plugin__wp_show_ids_temp_dir = dirname (__FILE__) . "/functions"))
|
| 20 |
foreach (scandir ($ws_plugin__wp_show_ids_temp_dir) as $ws_plugin__wp_show_ids_temp_s)
|
| 21 |
-
if (preg_match ("/\.php$/", $ws_plugin__wp_show_ids_temp_s) &&
|
| 22 |
include_once $ws_plugin__wp_show_ids_temp_dir . "/" . $ws_plugin__wp_show_ids_temp_s;
|
| 23 |
/**/
|
| 24 |
unset ($ws_plugin__wp_show_ids_temp_dir, $ws_plugin__wp_show_ids_temp_s);
|
| 18 |
*/
|
| 19 |
if (is_dir ($ws_plugin__wp_show_ids_temp_dir = dirname (__FILE__) . "/functions"))
|
| 20 |
foreach (scandir ($ws_plugin__wp_show_ids_temp_dir) as $ws_plugin__wp_show_ids_temp_s)
|
| 21 |
+
if (preg_match ("/\.php$/", $ws_plugin__wp_show_ids_temp_s) && $ws_plugin__wp_show_ids_temp_s !== "index.php")
|
| 22 |
include_once $ws_plugin__wp_show_ids_temp_dir . "/" . $ws_plugin__wp_show_ids_temp_s;
|
| 23 |
/**/
|
| 24 |
unset ($ws_plugin__wp_show_ids_temp_dir, $ws_plugin__wp_show_ids_temp_s);
|
includes/functions/activate-deactivate.inc.php
DELETED
|
@@ -1,48 +0,0 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
/*
|
| 3 |
-
Copyright: © 2009 WebSharks, Inc. ( coded in the USA )
|
| 4 |
-
<mailto:support@websharks-inc.com> <http://www.websharks-inc.com/>
|
| 5 |
-
|
| 6 |
-
Released under the terms of the GNU General Public License.
|
| 7 |
-
You should have received a copy of the GNU General Public License,
|
| 8 |
-
along with this software. In the main directory, see: /licensing/
|
| 9 |
-
If not, see: <http://www.gnu.org/licenses/>.
|
| 10 |
-
*/
|
| 11 |
-
/*
|
| 12 |
-
Direct access denial.
|
| 13 |
-
*/
|
| 14 |
-
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
| 15 |
-
exit ("Do not access this file directly.");
|
| 16 |
-
/*
|
| 17 |
-
Function for handling activation routines.
|
| 18 |
-
This function should match the array key for this plugin:
|
| 19 |
-
ws_plugin__$plugin_key_activate() is called by our themes.
|
| 20 |
-
*/
|
| 21 |
-
if (!function_exists ("ws_plugin__wp_show_ids_activate"))
|
| 22 |
-
{
|
| 23 |
-
function ws_plugin__wp_show_ids_activate ()
|
| 24 |
-
{
|
| 25 |
-
do_action ("ws_plugin__wp_show_ids_before_activation", get_defined_vars ());
|
| 26 |
-
/**/
|
| 27 |
-
do_action ("ws_plugin__wp_show_ids_after_activation", get_defined_vars ());
|
| 28 |
-
/**/
|
| 29 |
-
return;
|
| 30 |
-
}
|
| 31 |
-
}
|
| 32 |
-
/*
|
| 33 |
-
Function for handling de-activation cleanup routines.
|
| 34 |
-
This function should match the array key for this plugin:
|
| 35 |
-
ws_plugin__$plugin_key_deactivate() is called by our themes.
|
| 36 |
-
*/
|
| 37 |
-
if (!function_exists ("ws_plugin__wp_show_ids_deactivate"))
|
| 38 |
-
{
|
| 39 |
-
function ws_plugin__wp_show_ids_deactivate ()
|
| 40 |
-
{
|
| 41 |
-
do_action ("ws_plugin__wp_show_ids_before_deactivation", get_defined_vars ());
|
| 42 |
-
/**/
|
| 43 |
-
do_action ("ws_plugin__wp_show_ids_after_deactivation", get_defined_vars ());
|
| 44 |
-
/**/
|
| 45 |
-
return;
|
| 46 |
-
}
|
| 47 |
-
}
|
| 48 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/functions/class-autoloader.inc.php
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/*
|
| 3 |
+
Copyright: © 2009 WebSharks, Inc. ( coded in the USA )
|
| 4 |
+
<mailto:support@websharks-inc.com> <http://www.websharks-inc.com/>
|
| 5 |
+
|
| 6 |
+
Released under the terms of the GNU General Public License.
|
| 7 |
+
You should have received a copy of the GNU General Public License,
|
| 8 |
+
along with this software. In the main directory, see: /licensing/
|
| 9 |
+
If not, see: <http://www.gnu.org/licenses/>.
|
| 10 |
+
*/
|
| 11 |
+
/*
|
| 12 |
+
Direct access denial.
|
| 13 |
+
*/
|
| 14 |
+
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
| 15 |
+
exit ("Do not access this file directly.");
|
| 16 |
+
/*
|
| 17 |
+
The __autoload function for all WP Show IDs plugin classes.
|
| 18 |
+
This highly optimizes the plugin. Giving it a much smaller footprint.
|
| 19 |
+
See: http://www.php.net/manual/en/function.spl-autoload-register.php
|
| 20 |
+
*/
|
| 21 |
+
if (!function_exists ("ws_plugin__wp_show_ids_classes")) /* Already exists? */
|
| 22 |
+
{
|
| 23 |
+
function ws_plugin__wp_show_ids_classes ($class = FALSE) /* Build dynamic __autoload function. */
|
| 24 |
+
{
|
| 25 |
+
static $c; /* Holds the classes directory location ( location is optimized with a static var ). */
|
| 26 |
+
static $c_class_dirs; /* All possible dir & sub-directory locations ( with a static var ). */
|
| 27 |
+
/**/
|
| 28 |
+
if (strpos ($class, "c_ws_plugin__wp_show_ids_") === 0) /* Quick check. Is this a class for the plugin? */
|
| 29 |
+
{
|
| 30 |
+
$c = (!isset ($c)) ? dirname (dirname (__FILE__)) . "/classes" : $c; /* Configures location of classes. */
|
| 31 |
+
$c_class_dirs = (!isset ($c_class_dirs)) ? array_merge (array ($c), _ws_plugin__wp_show_ids_classes_scan_dirs_r ($c)) : $c_class_dirs;
|
| 32 |
+
/**/
|
| 33 |
+
$class = str_replace ("_", "-", str_replace ("c_ws_plugin__wp_show_ids_", "", $class));
|
| 34 |
+
/**/
|
| 35 |
+
foreach ($c_class_dirs as $class_dir) /* Start looking for the class. */
|
| 36 |
+
if ($class_dir === $c || strpos ($class, basename ($class_dir)) === 0)
|
| 37 |
+
if (file_exists ($class_dir . "/" . $class . ".inc.php"))
|
| 38 |
+
{
|
| 39 |
+
include_once $class_dir . "/" . $class . ".inc.php";
|
| 40 |
+
/**/
|
| 41 |
+
break; /* Now stop looking. */
|
| 42 |
+
}
|
| 43 |
+
}
|
| 44 |
+
}
|
| 45 |
+
function _ws_plugin__wp_show_ids_classes_scan_dirs_r ($starting_dir = FALSE)
|
| 46 |
+
{
|
| 47 |
+
$dirs = array (); /* Initialize dirs array. */
|
| 48 |
+
/**/
|
| 49 |
+
foreach (func_get_args () as $starting_dir)
|
| 50 |
+
if (is_dir ($starting_dir)) /* Does this directory exist? */
|
| 51 |
+
foreach (scandir ($starting_dir) as $dir) /* Scan this directory. */
|
| 52 |
+
if ($dir !== "." && $dir !== ".." && is_dir ($dir = $starting_dir . "/" . $dir))
|
| 53 |
+
$dirs = array_merge ($dirs, array ($dir), _ws_plugin__wp_show_ids_classes_scan_dirs_r ($dir));
|
| 54 |
+
/**/
|
| 55 |
+
return $dirs; /* Return array of all directories. */
|
| 56 |
+
}
|
| 57 |
+
/**/
|
| 58 |
+
spl_autoload_register ("ws_plugin__wp_show_ids_classes"); /* Register __autoload. */
|
| 59 |
+
}
|
| 60 |
+
?>
|
includes/functions/column-handlers.inc.php
DELETED
|
@@ -1,61 +0,0 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
/*
|
| 3 |
-
Copyright: © 2009 WebSharks, Inc. ( coded in the USA )
|
| 4 |
-
<mailto:support@websharks-inc.com> <http://www.websharks-inc.com/>
|
| 5 |
-
|
| 6 |
-
Released under the terms of the GNU General Public License.
|
| 7 |
-
You should have received a copy of the GNU General Public License,
|
| 8 |
-
along with this software. In the main directory, see: /licensing/
|
| 9 |
-
If not, see: <http://www.gnu.org/licenses/>.
|
| 10 |
-
*/
|
| 11 |
-
/*
|
| 12 |
-
Direct access denial.
|
| 13 |
-
*/
|
| 14 |
-
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
| 15 |
-
exit ("Do not access this file directly.");
|
| 16 |
-
/*
|
| 17 |
-
Add the wp_show_ids column.
|
| 18 |
-
*/
|
| 19 |
-
if (!function_exists ("_ws_plugin__wp_show_ids_return_column"))
|
| 20 |
-
{
|
| 21 |
-
function _ws_plugin__wp_show_ids_return_column ($cols = FALSE)
|
| 22 |
-
{
|
| 23 |
-
return apply_filters ("_ws_plugin__wp_show_ids_return_column", array_merge ($cols, array ("ws_plugin__wp_show_ids" => "ID")), get_defined_vars ());
|
| 24 |
-
}
|
| 25 |
-
}
|
| 26 |
-
/*
|
| 27 |
-
Return the wp_show_ids column value.
|
| 28 |
-
*/
|
| 29 |
-
if (!function_exists ("_ws_plugin__wp_show_ids_return_value"))
|
| 30 |
-
{
|
| 31 |
-
function _ws_plugin__wp_show_ids_return_value ($value = FALSE, $column_name = FALSE, $id = FALSE)
|
| 32 |
-
{
|
| 33 |
-
return apply_filters ("_ws_plugin__wp_show_ids_return_value", ( ($column_name === "ws_plugin__wp_show_ids") ? $id : $value), get_defined_vars ());
|
| 34 |
-
}
|
| 35 |
-
}
|
| 36 |
-
/*
|
| 37 |
-
Echo the wp_show_ids column value.
|
| 38 |
-
*/
|
| 39 |
-
if (!function_exists ("_ws_plugin__wp_show_ids_echo_value"))
|
| 40 |
-
{
|
| 41 |
-
function _ws_plugin__wp_show_ids_echo_value ($column_name = FALSE, $id = FALSE)
|
| 42 |
-
{
|
| 43 |
-
echo apply_filters ("_ws_plugin__wp_show_ids_echo_value", ( ($column_name === "ws_plugin__wp_show_ids") ? $id : null), get_defined_vars ());
|
| 44 |
-
}
|
| 45 |
-
}
|
| 46 |
-
/*
|
| 47 |
-
Echo the wp_show_ids column css for width.
|
| 48 |
-
*/
|
| 49 |
-
if (!function_exists ("_ws_plugin__wp_show_ids_echo_css"))
|
| 50 |
-
{
|
| 51 |
-
function _ws_plugin__wp_show_ids_echo_css ()
|
| 52 |
-
{
|
| 53 |
-
$css = '<style type="text/css">';
|
| 54 |
-
$css .= 'th.column-ws_plugin__wp_show_ids { width: 45px; text-align:center; }';
|
| 55 |
-
$css .= 'td.column-ws_plugin__wp_show_ids { width: 45px; text-align:center; }';
|
| 56 |
-
$css .= '</style>';
|
| 57 |
-
/**/
|
| 58 |
-
echo apply_filters ("_ws_plugin__wp_show_ids_echo_css", $css, get_defined_vars ());
|
| 59 |
-
}
|
| 60 |
-
}
|
| 61 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/functions/configure-columns.inc.php
DELETED
|
@@ -1,68 +0,0 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
/*
|
| 3 |
-
Copyright: © 2009 WebSharks, Inc. ( coded in the USA )
|
| 4 |
-
<mailto:support@websharks-inc.com> <http://www.websharks-inc.com/>
|
| 5 |
-
|
| 6 |
-
Released under the terms of the GNU General Public License.
|
| 7 |
-
You should have received a copy of the GNU General Public License,
|
| 8 |
-
along with this software. In the main directory, see: /licensing/
|
| 9 |
-
If not, see: <http://www.gnu.org/licenses/>.
|
| 10 |
-
*/
|
| 11 |
-
/*
|
| 12 |
-
Direct access denial.
|
| 13 |
-
*/
|
| 14 |
-
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
| 15 |
-
exit ("Do not access this file directly.");
|
| 16 |
-
/*
|
| 17 |
-
Configure all of the required Hooks/Filters for columns & css.
|
| 18 |
-
Attach to: add_action("admin_init");
|
| 19 |
-
*/
|
| 20 |
-
if (!function_exists ("ws_plugin__wp_show_ids_configure"))
|
| 21 |
-
{
|
| 22 |
-
function ws_plugin__wp_show_ids_configure () /* The magic happens here. */
|
| 23 |
-
{
|
| 24 |
-
global $wp_post_types, $wp_taxonomies; /* Grab these global references. */
|
| 25 |
-
/**/
|
| 26 |
-
do_action ("ws_plugin__wp_show_ids_before_configure", get_defined_vars ());
|
| 27 |
-
/**/
|
| 28 |
-
add_action ("admin_head", "_ws_plugin__wp_show_ids_echo_css"); /* Add CSS. */
|
| 29 |
-
/**/
|
| 30 |
-
add_filter ("manage_edit-post_columns", "_ws_plugin__wp_show_ids_return_column");
|
| 31 |
-
add_action ("manage_posts_custom_column", "_ws_plugin__wp_show_ids_echo_value", 10, 2);
|
| 32 |
-
/**/
|
| 33 |
-
add_filter ("manage_edit-comments_columns", "_ws_plugin__wp_show_ids_return_column");
|
| 34 |
-
add_action ("manage_comments_custom_column", "_ws_plugin__wp_show_ids_echo_value", 10, 2);
|
| 35 |
-
/**/
|
| 36 |
-
add_filter ("manage_edit-page_columns", "_ws_plugin__wp_show_ids_return_column");
|
| 37 |
-
add_action ("manage_pages_custom_column", "_ws_plugin__wp_show_ids_echo_value", 10, 2);
|
| 38 |
-
/**/
|
| 39 |
-
add_filter ("manage_link-manager_columns", "_ws_plugin__wp_show_ids_return_column");
|
| 40 |
-
add_action ("manage_link_custom_column", "_ws_plugin__wp_show_ids_echo_value", 10, 2);
|
| 41 |
-
/**/
|
| 42 |
-
add_filter ("manage_edit-link-categories_columns", "_ws_plugin__wp_show_ids_return_column");
|
| 43 |
-
add_filter ("manage_link_categories_custom_column", "_ws_plugin__wp_show_ids_return_value", 10, 3);
|
| 44 |
-
/**/
|
| 45 |
-
add_filter ("manage_upload_columns", "_ws_plugin__wp_show_ids_return_column");
|
| 46 |
-
add_action ("manage_media_custom_column", "_ws_plugin__wp_show_ids_echo_value", 10, 2);
|
| 47 |
-
/**/
|
| 48 |
-
add_filter ("manage_users_columns", "_ws_plugin__wp_show_ids_return_column");
|
| 49 |
-
add_filter ("manage_users_custom_column", "_ws_plugin__wp_show_ids_return_value", 10, 3);
|
| 50 |
-
/**/
|
| 51 |
-
if (is_array ($wp_post_types))
|
| 52 |
-
foreach ($wp_post_types as $type => $post_type_object) /* Handle WP 3.0+ Post Types. */
|
| 53 |
-
{
|
| 54 |
-
add_action ("manage_edit-${type}_columns", "_ws_plugin__wp_show_ids_return_column");
|
| 55 |
-
add_filter ("manage_${type}_custom_column", "_ws_plugin__wp_show_ids_return_value", 10, 3);
|
| 56 |
-
}
|
| 57 |
-
/**/
|
| 58 |
-
if (is_array ($wp_taxonomies))
|
| 59 |
-
foreach ($wp_taxonomies as $taxonomy => $taxonomy_o) /* Handle WP 3.0+ Taxonomies. */
|
| 60 |
-
{
|
| 61 |
-
add_action ("manage_edit-${taxonomy}_columns", "_ws_plugin__wp_show_ids_return_column");
|
| 62 |
-
add_filter ("manage_${taxonomy}_custom_column", "_ws_plugin__wp_show_ids_return_value", 10, 3);
|
| 63 |
-
}
|
| 64 |
-
/**/
|
| 65 |
-
do_action ("ws_plugin__wp_show_ids_after_configure", get_defined_vars ());
|
| 66 |
-
}
|
| 67 |
-
}
|
| 68 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/functions/deprecated.inc.php
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/*
|
| 3 |
+
Copyright: © 2009 WebSharks, Inc. ( coded in the USA )
|
| 4 |
+
<mailto:support@websharks-inc.com> <http://www.websharks-inc.com/>
|
| 5 |
+
|
| 6 |
+
Released under the terms of the GNU General Public License.
|
| 7 |
+
You should have received a copy of the GNU General Public License,
|
| 8 |
+
along with this software. In the main directory, see: /licensing/
|
| 9 |
+
If not, see: <http://www.gnu.org/licenses/>.
|
| 10 |
+
*/
|
| 11 |
+
/*
|
| 12 |
+
Direct access denial.
|
| 13 |
+
*/
|
| 14 |
+
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
| 15 |
+
exit ("Do not access this file directly.");
|
| 16 |
+
/*
|
| 17 |
+
As of v1.2+, these two functions are deprecated ( i.e. do NOT use ).
|
| 18 |
+
All older PriMoThemes called upon the activate/deactivate functions.
|
| 19 |
+
*/
|
| 20 |
+
function ws_plugin__wp_show_ids_activate () /* Call with classes. */
|
| 21 |
+
{
|
| 22 |
+
return c_ws_plugin__wp_show_ids_installation::activate ();
|
| 23 |
+
}
|
| 24 |
+
/**/
|
| 25 |
+
function ws_plugin__wp_show_ids_deactivate () /* Call class. */
|
| 26 |
+
{
|
| 27 |
+
return c_ws_plugin__wp_show_ids_installation::deactivate ();
|
| 28 |
+
}
|
| 29 |
+
?>
|
includes/hooks.inc.php
CHANGED
|
@@ -12,9 +12,14 @@ If not, see: <http://www.gnu.org/licenses/>.
|
|
| 12 |
Direct access denial.
|
| 13 |
*/
|
| 14 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
| 15 |
-
exit("Do not access this file directly.");
|
| 16 |
/*
|
| 17 |
Add the plugin Actions/Filters here.
|
| 18 |
*/
|
| 19 |
-
add_action ("admin_init", "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
?>
|
| 12 |
Direct access denial.
|
| 13 |
*/
|
| 14 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
| 15 |
+
exit ("Do not access this file directly.");
|
| 16 |
/*
|
| 17 |
Add the plugin Actions/Filters here.
|
| 18 |
*/
|
| 19 |
+
add_action ("admin_init", "c_ws_plugin__wp_show_ids_columns::configure");
|
| 20 |
+
/*
|
| 21 |
+
Register the activation | de-activation routines.
|
| 22 |
+
*/
|
| 23 |
+
register_activation_hook ($GLOBALS["WS_PLUGIN__"]["wp_show_ids"]["l"], "c_ws_plugin__wp_show_ids_installation::activate");
|
| 24 |
+
register_deactivation_hook ($GLOBALS["WS_PLUGIN__"]["wp_show_ids"]["l"], "c_ws_plugin__wp_show_ids_installation::deactivate");
|
| 25 |
?>
|
includes/syscon.inc.php
CHANGED
|
@@ -12,13 +12,13 @@ If not, see: <http://www.gnu.org/licenses/>.
|
|
| 12 |
Direct access denial.
|
| 13 |
*/
|
| 14 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
| 15 |
-
exit("Do not access this file directly.");
|
| 16 |
/*
|
| 17 |
Determine the full URL to the directory this plugin resides in.
|
| 18 |
*/
|
| 19 |
$GLOBALS["WS_PLUGIN__"]["wp_show_ids"]["c"]["dir_url"] = content_url () . preg_replace ("/^(.*?)(\/" . preg_quote (basename (WP_CONTENT_DIR), "/") . ")/", "", preg_replace ("/" . preg_quote (DIRECTORY_SEPARATOR, "/") . "/", "/", dirname (dirname (__FILE__))));
|
| 20 |
/*
|
| 21 |
-
Configure
|
| 22 |
*/
|
| 23 |
-
$GLOBALS["WS_PLUGIN__"]["wp_show_ids"]["c"]["
|
| 24 |
?>
|
| 12 |
Direct access denial.
|
| 13 |
*/
|
| 14 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
| 15 |
+
exit ("Do not access this file directly.");
|
| 16 |
/*
|
| 17 |
Determine the full URL to the directory this plugin resides in.
|
| 18 |
*/
|
| 19 |
$GLOBALS["WS_PLUGIN__"]["wp_show_ids"]["c"]["dir_url"] = content_url () . preg_replace ("/^(.*?)(\/" . preg_quote (basename (WP_CONTENT_DIR), "/") . ")/", "", preg_replace ("/" . preg_quote (DIRECTORY_SEPARATOR, "/") . "/", "/", dirname (dirname (__FILE__))));
|
| 20 |
/*
|
| 21 |
+
Configure checksum time for the syscon.inc.php file.
|
| 22 |
*/
|
| 23 |
+
$GLOBALS["WS_PLUGIN__"]["wp_show_ids"]["c"]["checksum"] = filemtime (__FILE__); /* File modification time. */
|
| 24 |
?>
|
readme.txt
CHANGED
|
@@ -1,8 +1,8 @@
|
|
| 1 |
=== WP Show IDs ( simple, yet elegant ) ===
|
| 2 |
|
| 3 |
-
Version: 1.
|
| 4 |
-
Stable tag: 1.
|
| 5 |
-
Framework: WS-
|
| 6 |
|
| 7 |
WordPress Compatible: yes
|
| 8 |
WP Multisite Compatible: yes
|
|
@@ -55,6 +55,11 @@ Yes, this plugin supports WordPress® 3.0+; even Custom Post Types & Custom
|
|
| 55 |
|
| 56 |
== Changelog ==
|
| 57 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 58 |
= 1.0.6 =
|
| 59 |
* Framework updated; general cleanup.
|
| 60 |
* Updated for compatibility with WordPress® 3.1.
|
| 1 |
=== WP Show IDs ( simple, yet elegant ) ===
|
| 2 |
|
| 3 |
+
Version: 1.2
|
| 4 |
+
Stable tag: 1.2
|
| 5 |
+
Framework: WS-LP-3.5
|
| 6 |
|
| 7 |
WordPress Compatible: yes
|
| 8 |
WP Multisite Compatible: yes
|
| 55 |
|
| 56 |
== Changelog ==
|
| 57 |
|
| 58 |
+
= 1.2 =
|
| 59 |
+
* Framework updated; general cleanup.
|
| 60 |
+
* Updated with static class methods. This plugin now uses PHP's SPL autoload functionality to further optimize all of its routines.
|
| 61 |
+
* Optimizations. Further internal optimizations applied through configuration checksums.
|
| 62 |
+
|
| 63 |
= 1.0.6 =
|
| 64 |
* Framework updated; general cleanup.
|
| 65 |
* Updated for compatibility with WordPress® 3.1.
|
wp-show-ids.php
CHANGED
|
@@ -9,9 +9,9 @@ along with this software. In the main directory, see: /licensing/
|
|
| 9 |
If not, see: <http://www.gnu.org/licenses/>.
|
| 10 |
*/
|
| 11 |
/*
|
| 12 |
-
Version: 1.
|
| 13 |
-
Stable tag: 1.
|
| 14 |
-
Framework: WS-
|
| 15 |
|
| 16 |
WordPress Compatible: yes
|
| 17 |
WP Multisite Compatible: yes
|
|
@@ -42,7 +42,7 @@ if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
|
| 42 |
/*
|
| 43 |
Define versions.
|
| 44 |
*/
|
| 45 |
-
define ("WS_PLUGIN__WP_SHOW_IDS_VERSION", "1.
|
| 46 |
define ("WS_PLUGIN__WP_SHOW_IDS_MIN_PHP_VERSION", "5.2");
|
| 47 |
define ("WS_PLUGIN__WP_SHOW_IDS_MIN_WP_VERSION", "3.0");
|
| 48 |
/*
|
| 9 |
If not, see: <http://www.gnu.org/licenses/>.
|
| 10 |
*/
|
| 11 |
/*
|
| 12 |
+
Version: 1.2
|
| 13 |
+
Stable tag: 1.2
|
| 14 |
+
Framework: WS-LP-3.5
|
| 15 |
|
| 16 |
WordPress Compatible: yes
|
| 17 |
WP Multisite Compatible: yes
|
| 42 |
/*
|
| 43 |
Define versions.
|
| 44 |
*/
|
| 45 |
+
define ("WS_PLUGIN__WP_SHOW_IDS_VERSION", "1.2");
|
| 46 |
define ("WS_PLUGIN__WP_SHOW_IDS_MIN_PHP_VERSION", "5.2");
|
| 47 |
define ("WS_PLUGIN__WP_SHOW_IDS_MIN_WP_VERSION", "3.0");
|
| 48 |
/*
|
