is_plugin_installed example


    protected function check_read_permission( $plugin ) {
        require_once ABSPATH . 'wp-admin/includes/plugin.php';

        if ( ! $this->is_plugin_installed( $plugin ) ) {
            return new WP_Error( 'rest_plugin_not_found', __( 'Plugin not found.' ), array( 'status' => 404 ) );
        }

        if ( ! is_multisite() ) {
            return true;
        }

        if ( ! is_network_only_plugin( $plugin ) || is_plugin_active( $plugin ) || current_user_can( 'manage_network_plugins' ) ) {
            return true;
        }

        
Home | Imprint | This part of the site doesn't use cookies.