From bba75e1a1a48b42138c0a1706d31d989feeb1e57 Mon Sep 17 00:00:00 2001 From: Oldperl <44996956+oldperl@users.noreply.github.com> Date: Thu, 29 Aug 2013 11:58:40 +0000 Subject: [PATCH] add wrapper for new functions due to compability on older wp --- includes/help/start.php | 4 ++-- semmelstatzR_startup.php | 9 ++++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/includes/help/start.php b/includes/help/start.php index ba5e8ab..26ea2d8 100644 --- a/includes/help/start.php +++ b/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/semmelstatzR_startup.php b/semmelstatzR_startup.php index 1bb2f0d..0f97439 100644 --- a/semmelstatzR_startup.php +++ b/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)); + } +} +?>