Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions inc/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public function setup_admin_hooks() {
add_action( 'wp_ajax_raft_dismiss_design_pack_notice', array( $this, 'remove_design_pack_notice' ) );
add_filter( 'themeisle_sdk_blackfriday_data', array( $this, 'add_black_friday_data' ) );
add_filter( 'raft_ai_connect_metadata', array( $this, 'get_ai_connect_metadata' ) );
add_filter( 'raft_support_hub_metadata', array( $this, 'get_support_hub_metadata' ) );
}

/**
Expand Down Expand Up @@ -461,4 +462,29 @@ public function get_ai_connect_metadata() {
),
);
}

/**
* Metadata for the Themeisle SDK Support Hub: the footer links shown in the Help form.
*
* Raft is a free theme with no Pro tier, so is_pro is always false.
*
* @return array{is_pro: bool, links: array<int, array{icon: string, text: string, url: string}>}
*/
public function get_support_hub_metadata() {
return array(
'is_pro' => false,
'links' => array(
array(
'icon' => 'book-alt',
'text' => __( 'Documentation', 'raft' ),
'url' => 'https://docs.themeisle.com/fse-themes/raft-fse-theme',
),
array(
'icon' => 'groups',
'text' => __( 'Community Forum', 'raft' ),
'url' => 'https://wordpress.org/support/theme/raft/',
),
),
);
}
}
Comment on lines +473 to 490

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tests Add a test for the new Support Hub opt-in. The PHPUnit suite (phpunit.xml, tests/test-*.php) exists, but no test exercises raft_support_hub_metadata or get_support_hub_metadata(). A broken registration or a renamed key would silently hide the Help button. Add tests/test-admin.php with a case that asserts apply_filters( 'raft_support_hub_metadata', array() ) returns is_pro === false and two links, each with non-empty icon, text and url. Without the change, the filter returns array() and the case fails.

Loading