Skip to content

Commit 9a146a5

Browse files
committed
Add abilities for Options Pages
1 parent 34a448e commit 9a146a5

File tree

3 files changed

+42
-1
lines changed

3 files changed

+42
-1
lines changed

includes/abilities/class-scf-abilities-integration.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ public function init() {
4242
acf_include( 'includes/abilities/class-scf-internal-post-type-abilities.php' );
4343
acf_include( 'includes/abilities/class-scf-post-type-abilities.php' );
4444
acf_include( 'includes/abilities/class-scf-taxonomy-abilities.php' );
45+
acf_include( 'includes/abilities/class-scf-ui-options-page-abilities.php' );
4546
}
4647

4748
/**
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?php
2+
/**
3+
* SCF UI Options Page Abilities
4+
*
5+
* Handles WordPress Abilities API registration for SCF UI options page management.
6+
*
7+
* @package wordpress/secure-custom-fields
8+
* @since 6.8.0
9+
*/
10+
11+
// Exit if accessed directly.
12+
if ( ! defined( 'ABSPATH' ) ) {
13+
exit;
14+
}
15+
16+
if ( ! class_exists( 'SCF_UI_Options_Page_Abilities' ) ) :
17+
18+
/**
19+
* SCF UI Options Page Abilities class.
20+
*
21+
* Registers and handles all UI options page management abilities for the
22+
* WordPress Abilities API integration. Provides programmatic access
23+
* to SCF UI options page operations.
24+
*
25+
* @since 6.8.0
26+
*/
27+
class SCF_UI_Options_Page_Abilities extends SCF_Internal_Post_Type_Abilities {
28+
29+
/**
30+
* The internal post type identifier.
31+
*
32+
* @var string
33+
*/
34+
protected $internal_post_type = 'acf-ui-options-page';
35+
}
36+
37+
// Initialize abilities instance.
38+
acf_new_instance( 'SCF_UI_Options_Page_Abilities' );
39+
40+
endif; // class_exists check.

includes/class-scf-json-schema-validator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class SCF_JSON_Schema_Validator {
2626
*
2727
* @var array
2828
*/
29-
public const REQUIRED_SCHEMAS = array( 'post-type', 'taxonomy', 'internal-fields', 'scf-identifier' );
29+
public const REQUIRED_SCHEMAS = array( 'post-type', 'taxonomy', 'ui-options-page', 'internal-fields', 'scf-identifier' );
3030

3131
/**
3232
* The last validation errors.

0 commit comments

Comments
 (0)