This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* These functions will goes to your qa-plugin.php | |
*/ | |
//registering plugin stuffs | |
qa_register_plugin_layer('q2am-item-output.php', 'Q2AM Item Layer'); | |
qa_register_plugin_module('page', 'q2am-item-page.php', 'q2am_item_page', 'Q2AM Item Page'); | |
qa_register_plugin_module('module', 'q2am-item-admin.php', 'q2am_item_admin', 'Q2AM Item Settings'); | |
qa_register_plugin_phrases('q2am-Item-lang.php', 'q2am_item_lang'); | |
/* | |
* Now you can check class in anywhere in the system | |
* using class_exists or checking in array using | |
* get_declared_classes() function | |
* | |
* You can use this in | |
* theme file | |
* another plugin file | |
* layer | |
* another class | |
* | |
* As far as class is available in the system, | |
* you can check it anywhere the same way like | |
* function_exists() for function | |
*/ | |
//now check if class is exists in the system | |
if(class_exists('q2am_item_page')) | |
{ | |
//do the stuffs | |
} | |
if(class_exists('q2am_item_page') && class_exists('q2am_item_admin') ....) | |
{ | |
//do the stuffs | |
} | |
//May be we can get list of classes and check in_array | |
$classes = get_declared_classes(); | |
if(in_array('q2am_item_page', $classes )) | |
{ | |
//do the stuffs | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment