PluginProbe
Floating Button – Easily Create Sticky, Fixed & Floating Buttons / 6.0.10
Floating Button – Easily Create Sticky, Fixed & Floating Buttons v6.0.10
trunk 2.0.2 3.0 4.0 4.1.2 4.3 5.0 5.0.1 5.1 5.1.1 5.2 5.3 5.3.1 6.0 6.0.1 6.0.10 6.0.11 6.0.12 6.0.13 6.0.2 6.0.3 6.0.4 6.0.5 6.0.6 6.0.7 All 31 releases
floating-button / classes / Publisher / Conditions.php

Conditions.php in Floating Button – Easily Create Sticky, Fixed & Floating Buttons 6.0.10, at classes/Publisher/Conditions.php

33 lines 623 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace FloatingButton\Publisher;
4
5 defined( 'ABSPATH' ) || exit;
6
7 class Conditions {
8
9 public static function init( $result ): bool {
10 $param = ! empty( $result->param ) ? maybe_unserialize( $result->param ) : [];
11 $check = [
12 'status' => self::status( $result->status ),
13 'mode' => self::mode( $result->mode ),
14 ];
15
16 if ( in_array( false, $check, true ) ) {
17 return false;
18 }
19
20 return true;
21
22 }
23
24 private static function status( $status ): bool {
25 return empty( $status );
26 }
27
28 private static function mode( $mode ): bool {
29 return empty( $mode ) || current_user_can( 'administrator' );
30 }
31
32
33 }