Skip to content

Commit

Permalink
Moving permalink settings to its own section.
Browse files Browse the repository at this point in the history
  • Loading branch information
ideadude committed Jan 18, 2024
1 parent c441ac5 commit 2d1c717
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion includes/admin/class-llms-admin-permalink-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,18 +200,36 @@ public static function init() {
*/
$setting_fields = apply_filters( 'llms_permalink_settings_fields', $setting_fields );

// Add LifterLMS section to the permalink settings page.
add_settings_section(
'llms_permalinks',
__( 'LifterLMS', 'lifterlms' ),
array( __CLASS__, 'section_description' ),
'permalink'
);

// Add the fields to the LifterLMS section.
foreach ( $setting_fields as $field_name => $config ) {
add_settings_field(
$field_name,
$config['label'],
$config['callback'],
'permalink',
$config['section'] ?? 'optional',
$config['section'] ?? 'llms_permalinks',
$config['args'] ?? array()
);
}
}

/**
* Echo the LifterLMS Permalinks section description.
*
* @since [version]
*/
public static function section_description() {
echo '<p>' . esc_html__( 'LifterLMS uses custom post types and taxonomies to organize your courses and memberships. You can customize the URLs for these items here.', 'lifterlms' ) . '</p>';
}

/**
* Render a slug input.
*
Expand Down

0 comments on commit 2d1c717

Please sign in to comment.