diff --git a/plugins/osi-features/acf-fields/group_68381f7bdc12b.json b/plugins/osi-features/acf-fields/group_68381f7bdc12b.json new file mode 100644 index 0000000..c48506a --- /dev/null +++ b/plugins/osi-features/acf-fields/group_68381f7bdc12b.json @@ -0,0 +1,72 @@ +{ + "key": "group_68381f7bdc12b", + "title": "AI Template Toggle", + "fields": [{ + "key": "field_68381f7c701f6", + "label": "Use AI Header", + "name": "osi_use_ai_header", + "aria-label": "", + "type": "true_false", + "instructions": "", + "required": 0, + "conditional_logic": 0, + "wrapper": { + "width": "", + "class": "", + "id": "" + }, + "relevanssi_exclude": 0, + "message": "This will use any menu named 'ai' for the menu when active", + "default_value": 0, + "allow_in_bindings": 0, + "ui": 0, + "ui_on_text": "", + "ui_off_text": "" + }, + { + "key": "field_68381fc3701f8", + "label": "Use AI Footer", + "name": "osi_use_ai_footer", + "aria-label": "", + "type": "true_false", + "instructions": "", + "required": 0, + "conditional_logic": 0, + "wrapper": { + "width": "", + "class": "", + "id": "" + }, + "relevanssi_exclude": 0, + "message": "When selected this will use the ai footer, you can edit the footer in reusable blocks.", + "default_value": 0, + "allow_in_bindings": 0, + "ui": 0, + "ui_on_text": "", + "ui_off_text": "" + } + ], + "location": [ + [{ + "param": "post_type", + "operator": "==", + "value": "page" + }, + { + "param": "post_template", + "operator": "==", + "value": "templates\/ai-wide.php" + } + ] + ], + "menu_order": 0, + "position": "normal", + "style": "default", + "label_placement": "top", + "instruction_placement": "label", + "hide_on_screen": "", + "active": true, + "description": "", + "show_in_rest": 0, + "modified": 1748508671 +} \ No newline at end of file diff --git a/themes/osi/footer-ai.php b/themes/osi/footer-ai.php index 9a860c9..396d1e3 100755 --- a/themes/osi/footer-ai.php +++ b/themes/osi/footer-ai.php @@ -8,173 +8,31 @@ * @package osi */ -// Get the footer icon -$image_url = get_template_directory_uri() . '/assets/img/osi-horizontal-white.svg'; - -// Compile the block markup for the footer -$footer_block = << - - -HTML; +$footer_block_id = osi_create_or_find_ai_footer_block_content(); ?> - - + diff --git a/themes/osi/inc/block-patterns.php b/themes/osi/inc/block-patterns.php index b4d3642..6d0735f 100644 --- a/themes/osi/inc/block-patterns.php +++ b/themes/osi/inc/block-patterns.php @@ -1,21 +1,42 @@ __('AI', 'osi')] // Category label (visible in the editor) - ); -}); +// General WordPress filters and actions for the Open Source AI Definition +add_filter( 'block_editor_rest_api_preload_paths', '__return_empty_array' ); +/** + * Registers teh AI patterns for the Open Source AI Definition. + * + * @return void + */ +function osi_register_ai_patterns() { + register_block_pattern_category( + 'ai', // Unique slug for the category + array( 'label' => __( 'AI', 'osi' ) ) // Category label (visible in the editor) + ); +} +add_action( 'init', 'osi_register_ai_patterns' ); + + +/** + * Registers the "About Area" pattern for the Open Source AI Definition. + * + * This pattern includes a reusable section with tabs and custom content. + * + * @return void + */ function osi_register_about_area_pattern() { - register_block_pattern( - 'custom/about-area', - [ - 'title' => __('About Area', 'osi'), - 'description' => __('A reusable section with tabs and custom content.', 'osi'), - 'categories' => ['ai'], - 'content' => ' + register_block_pattern( + 'custom/about-area', + array( + 'title' => __( 'About Area', 'osi' ), + 'description' => __( 'A reusable section with tabs and custom content.', 'osi' ), + 'categories' => array( 'ai' ), + 'content' => '
@@ -78,19 +99,26 @@ function osi_register_about_area_pattern() {
', - ] - ); + ) + ); } -add_action('init', 'osi_register_about_area_pattern'); +add_action( 'init', 'osi_register_about_area_pattern' ); +/** + * Registers the "Banner Area" pattern for the Open Source AI Definition. + * + * This pattern includes a banner section with a title, description, and button. + * + * @return void + */ function osi_register_banner_area_pattern() { - register_block_pattern( - 'custom/banner-area', - [ - 'title' => __('Banner Area', 'osi'), - 'description' => __('A banner section with a title, description, and button.', 'osi'), - 'categories' => ['ai'], - 'content' => ' + register_block_pattern( + 'custom/banner-area', + array( + 'title' => __( 'Banner Area', 'osi' ), + 'description' => __( 'A banner section with a title, description, and button.', 'osi' ), + 'categories' => array( 'ai' ), + 'content' => '