From 5e132d2c834eb556d88d8393decb36487e54140f Mon Sep 17 00:00:00 2001 From: oldperl Date: Thu, 29 Aug 2013 11:58:40 +0000 Subject: [PATCH] add wrapper for new functions due to compability on older wp --- trunk/includes/help/start.php | 4 ++-- trunk/semmelstatzR_startup.php | 9 ++++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/trunk/includes/help/start.php b/trunk/includes/help/start.php index ba5e8ab..26ea2d8 100644 --- a/trunk/includes/help/start.php +++ b/trunk/includes/help/start.php @@ -37,7 +37,7 @@ * @uses wp add_filter() */ function semr_admin_notice(){ - if(!strstr($_GET['page'], "semmelstatzR")) return; + if(!function_exists("get_user_meta") || !strstr($_GET['page'], "semmelstatzR")) return; global $current_user ; $user_id = $current_user->ID; if(get_user_meta($user_id, 'semr_ignore_notice')) return; @@ -130,4 +130,4 @@ function semmelstatzR_help($contextual_help, $screen_id, $screen) { return $semrContextHelp.$contextual_help; } add_filter('contextual_help', 'semmelstatzR_help', 10, 3); -?> \ No newline at end of file +?> diff --git a/trunk/semmelstatzR_startup.php b/trunk/semmelstatzR_startup.php index 1bb2f0d..0f97439 100644 --- a/trunk/semmelstatzR_startup.php +++ b/trunk/semmelstatzR_startup.php @@ -84,4 +84,11 @@ if(class_exists("Upgrademe")) { return 'http://www.php-backoffice.de/updates/test/semr_update.php'; } } -?> \ No newline at end of file + +// function wrappers for older wp versions +if(!function_exists("plugin_dir_path")) { + function plugin_dir_path($file) { + return trailingslashit(dirname($file)); + } +} +?>