I have in WordPress functions.php the following function:
if ( ! function_exists( 'mm_single_slider' ) ) :
function mm_single_slider($echo = true){
if ( class_exists( 'RW_Meta_Box' ) ) {
//Do Something
} else {
//Do other things
}
}
add_action('plugins_loaded','mm_single_slider' );
But the class_exists is not working, returns false. This class is in a plugin that is activated and obviously exists.
I have also in my functions.php file this:
require_once ('inc/mm-metabox.php');
this file includes a similar functions where the class_exists is working, returns true.
I have tried with the 'plugins_loaded' hook and without it.
What am I doing wrong? It seems that when the file is required the class_exists is working but not directly in the functions.php file?
Thank you very much for the help.