PluginProbe
Edit Flow / 0.9.2
Edit Flow v0.9.2
0.11.1 0.11.0 0.7.2 0.7.3 0.7.4 0.7.5 0.7.6 0.8 0.8.1 0.8.2 0.9 0.9.1 0.9.2 0.9.3 0.9.4 0.9.5 0.9.6 0.9.7 0.9.8 0.9.9 trunk 0.1.5 0.10.0 0.10.1 0.10.2 All 44 releases
← All changes | common/php/class-module.php +12 -1 0.90.9.2 View file →
@@ -27,8 +27,19 @@
27 27
28 28 function __construct() {}
29 29
30 30 /**
31 + * Returns whether the current module is enabled.
32 + *
33 + * @since 0.9.1
34 + *
35 + * @return <code>true</code> if the module is enabled, <code>false</code> otherwise
36 + */
37 + public function is_enabled() {
38 + return $this->module->options->enabled === 'on';
39 + }
40 +
41 + /**
31 42 * Returns whether the module with the given name is enabled.
32 43 *
33 44 * @since 0.7
34 45 *
@@ -37,9 +48,9 @@
37 48 */
38 49 function module_enabled( $slug ) {
39 50 global $edit_flow;
40 51
41 - return isset( $edit_flow->$slug ) && $edit_flow->$slug->module->options->enabled == 'on';
52 + return isset( $edit_flow->$slug ) && $edit_flow->$slug->is_enabled();
42 53 }
43 54
44 55 /**
45 56 * Gets an array of allowed post types for a module