Skip to content

Commit

Permalink
deleted the old help links function
Browse files Browse the repository at this point in the history
  • Loading branch information
amirition committed Jun 4, 2024
1 parent 86ebf80 commit 0fa0c5c
Showing 1 changed file with 0 additions and 47 deletions.
47 changes: 0 additions & 47 deletions src/Admin/Settings_Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,53 +74,6 @@ public function add_settings_page() {
);
}

/**
* Return the description for the main title of a settings tab/section
* including the links below the description
* (as a filterable array of [ 'url', 'label', 'class' ])
*
* @param Plugin $plugin
* @param string $description The text of the description
*
* @return string
*/
public function get_title_description( $plugin, $description ) {
$links = apply_filters(
'barn2_plugins_title_links',
[
'doc' => [
'url' => 'https://barn2.com/kb-categories/posts-table-search-sort-free-kb/',
'label' => __( 'Documentation', 'posts-data-table' ),
'target' => '_blank',
],
'wizard' => [
'url' => esc_url( admin_url( 'admin.php?page=posts-data-table-setup-wizard' ) ),
'label' => __( 'Setup wizard', 'posts-data-table' ),
'target' => '_blank',
],
'support' => [
'url' => 'https://wordpress.org/support/plugin/posts-data-table/',
'label' => __( 'Support', 'posts-data-table' ),
'target' => '_blank',
],
],
$plugin
);

$printed_links = implode(
' | ',
array_map(
function ( $link ) {
$target = isset( $link['target'] ) ? sprintf( ' target="%s"', esc_attr( $link['target'] ) ) : '';

return sprintf( '<a href="%s"%s>%s</a>', esc_url( $link['url'] ), $target, esc_html( $link['label'] ) );
},
$links
)
);

return sprintf( '<p>%s</p><p>%s</p>', $printed_links, esc_html( $description ) );
}

public function render_settings_page() {
?>
Expand Down

0 comments on commit 0fa0c5c

Please sign in to comment.