# float-menu/6.1/classes/Publish/Conditions.php

Float menu – awesome floating side menu, version 6.1. 51 lines.

- Page: https://pluginprobe.com/plugins/float-menu/6.1/code/classes/Publish/Conditions.php
- Raw: https://pluginprobe.com/plugins/float-menu/6.1/raw/classes/Publish/Conditions.php
- Modified: 2024-11-25T08:47:24+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/float-menu/6.1/code/classes/Publish/Conditions.php#L10-L20`.

```php
<?php

/**
 * Class Conditions
 *
 * Provides methods to check conditions for displaying item
 *
 * @package    WowPlugin
 * @subpackage Publish
 * @author     Dmytro Lobov <dev@wow-company.com>, Wow-Company
 * @copyright  2024 Dmytro Lobov
 * @license    GPL-2.0+
 */

namespace FloatMenuLite\Publish;

use FloatMenuLite\WOWP_Plugin;
use FloatMenuLite\WOWP_Public;

defined( 'ABSPATH' ) || exit;

class Conditions {

	public static function init( $result ): bool {
		$param = ! empty( $result->param ) ? maybe_unserialize( $result->param ) : [];

		$check = [
			'status'         => self::status( $result->status ),
			'mode'           => self::mode( $result->mode ),
		];

		$check = apply_filters(WOWP_Plugin::PREFIX . '_conditions',  $check);

		if ( in_array( false, $check, true ) ) {
			return false;
		}

		return true;

	}

	private static function status( $status ): bool {
		return empty( $status );
	}

	private static function mode( $mode ): bool {
		return empty( $mode ) || current_user_can( 'manage_options' );
	}


}
```
