' . esc_html__( 'OMS QuietAdmin: Another version of OMS QuietAdmin (Free or Pro) is already active. Please deactivate the other version first.', 'oms-quietadmin' ) . '

'; } ); } else { /** * Uninstall routine: removes data only if the setting "Remove all settings * and logs when the plugin is deleted" is enabled. * * @since 0.9.0 * * @return void */ function quietadmin_uninstall() { require_once __DIR__ . '/includes/class-quietadmin-autoloader.php'; QuietAdmin_Autoloader::register(); QuietAdmin\Install::uninstall(); } register_uninstall_hook( __FILE__, 'quietadmin_uninstall' ); define( 'QUIETADMIN_VERSION', '0.9.5' ); define( 'QUIETADMIN_FILE', __FILE__ ); define( 'QUIETADMIN_PATH', plugin_dir_path( __FILE__ ) ); define( 'QUIETADMIN_URL', plugin_dir_url( __FILE__ ) ); define( 'QUIETADMIN_BASENAME', plugin_basename( __FILE__ ) ); define( 'QUIETADMIN_DB_VERSION', '0.1.0' ); require_once QUIETADMIN_PATH . 'includes/class-quietadmin-autoloader.php'; QuietAdmin_Autoloader::register(); register_activation_hook( __FILE__, array( 'QuietAdmin\Install', 'activate' ) ); register_deactivation_hook( __FILE__, array( 'QuietAdmin\Install', 'deactivate' ) ); /** * Starts the plugin. * * Deliberately runs only on `plugins_loaded` so that translations, MU plugins * and other plugins (e.g. WooCommerce) are already registered. * * @since 0.1.0 * * @return void */ function quietadmin() { add_action( 'init', array( 'QuietAdmin\Plugin', 'instance' ), 20 ); } add_action( 'plugins_loaded', 'quietadmin', 20 ); /** * Points the "Pro" teaser to the Pro checkout. * * @since 0.9.1 * * @return string */ function quietadmin_upgrade_url() { return 'https://onlinemarketing-sonntag.de/plugins/quietadmin/'; } add_filter( 'quietadmin_pro_url', 'quietadmin_upgrade_url' ); /** * Helper: reads a plugin option. * * Shorthand for QuietAdmin\Options::get() for templates and third-party code. * * @since 0.1.0 * * @param string $key Option key. * @param mixed $default_value Fallback if the key is not set. * @return mixed */ function quietadmin_get_option( $key, $default_value = null ) { return QuietAdmin\Options::get( $key, $default_value ); } /** * Is the current user currently in the reduced client view? * * True for the "OMS QuietAdmin Client" role AND for agencies in Ghost Mode. * * @since 0.1.0 * * @return bool */ function quietadmin_is_client_mode() { return QuietAdmin\ClientMode::is_active(); } /** * Renders a template from includes/Admin/Views/ or includes/Views/. * * Convenience wrapper around QuietAdmin\Template::render() for themes and * third-party code. The plugin's own classes use the Template class directly. * * @since 0.1.0 * * @param string $template File name without extension, e.g. 'dashboard-status'. * @param array $args Variables available in the template. * @param string $context 'admin' (includes/Admin/Views) or 'public' (includes/Views). * @return void */ function quietadmin_get_template( $template, $args = array(), $context = 'admin' ) { QuietAdmin\Template::render( $template, $args, $context ); } }