PluginProbe ʕ •ᴥ•ʔ
Secure Custom Fields / 6.9.1
Secure Custom Fields v6.9.1
6.9.1 6.9.0 6.8.9 6.8.7 6.8.8 6.8.6 6.8.4 6.8.5 trunk 6.4.0-beta1 6.4.0-beta2 6.4.1 6.4.1-beta3 6.4.1-beta4 6.4.1-beta5 6.4.1-beta6 6.4.1-beta7 6.4.2 6.5.0 6.5.1 6.5.2 6.5.3 6.5.4 6.5.5 6.5.6 6.5.7 6.6.0 6.7.0 6.7.1 6.8.0 6.8.1 6.8.2 6.8.3
secure-custom-fields / includes / abilities / class-scf-abilities-integration.php
secure-custom-fields / includes / abilities Last commit date
class-scf-abilities-integration.php 6 months ago class-scf-field-abilities.php 1 week ago class-scf-field-group-abilities.php 6 months ago class-scf-internal-post-type-abilities.php 1 week ago class-scf-post-type-abilities.php 7 months ago class-scf-taxonomy-abilities.php 7 months ago class-scf-ui-options-page-abilities.php 6 months ago
class-scf-abilities-integration.php
64 lines
1 <?php
2 /**
3 * WordPress Abilities API integration for Secure Custom Fields.
4 *
5 * @package SCF
6 * @since 6.6.0
7 */
8
9 if ( ! defined( 'ABSPATH' ) ) {
10 exit;
11 }
12
13 if ( ! class_exists( 'SCF_Abilities_Integration' ) ) {
14
15 /**
16 * Handles integration with WordPress Abilities API.
17 *
18 * @since 6.6.0
19 * @codeCoverageIgnore Glue code tested implicitly via E2E tests.
20 */
21 class SCF_Abilities_Integration {
22
23 /**
24 * Constructor.
25 *
26 * @since 6.6.0
27 */
28 public function __construct() {
29 add_action( 'plugins_loaded', array( $this, 'init' ), 20 );
30 }
31
32 /**
33 * Initialize abilities integration if dependencies are available.
34 *
35 * @since 6.6.0
36 */
37 public function init() {
38 if ( ! $this->dependencies_available() ) {
39 return;
40 }
41
42 acf_include( 'includes/abilities/class-scf-internal-post-type-abilities.php' );
43 acf_include( 'includes/abilities/class-scf-post-type-abilities.php' );
44 acf_include( 'includes/abilities/class-scf-taxonomy-abilities.php' );
45 acf_include( 'includes/abilities/class-scf-ui-options-page-abilities.php' );
46 acf_include( 'includes/abilities/class-scf-field-group-abilities.php' );
47 acf_include( 'includes/abilities/class-scf-field-abilities.php' );
48 }
49
50 /**
51 * Check if required dependencies are available.
52 *
53 * @since 6.6.0
54 * @return bool True if dependencies are available.
55 */
56 private function dependencies_available() {
57 return function_exists( 'wp_register_ability' )
58 && function_exists( 'wp_register_ability_category' );
59 }
60 }
61
62 acf_new_instance( 'SCF_Abilities_Integration' );
63 }
64