if plugin is active? check if plugin is enabled or not?
Question
I’m using the mingle plugin and the mingle-forum plugin.
I want to show a certain part on my site only if those two plugins are active. How can I solve this?
<?php if ( is_plugin_active('mingle-forum') ) { ?>
<div id="login"><?php include (TEMPLATEPATH . '/inc/userlogin.php' ); ?></div>
<?php } ?>
This throws a php error. Call to undefined function is_plugin_active
Any idea what I’m doing wrong?
update:
<?php if ( plugin_active('plugin-directory/mingle-forum/wpf-main.php') ) { ?>
<div id="login"><?php include (TEMPLATEPATH . '/inc/userlogin.php' ); ?></div>
<?php } ?>
in progress
0
functions, php, plugins
12 years
2011-04-21T07:35:18-05:00
2011-04-21T07:35:18-05:00 0 Answer
84 views
0
Answer ( 1 )
This function exists in
wp-admin/includes/plugin.php
so I’m assuming it doesn’t get included by the theme.You can either
require
it, or just create your own version of it – see here: http://wordpress.org/support/topic/is_plugin_activeUPDATED:
Please check
is_plugin_active