forwp/account-menu',
'[forwp_account_menu]',
)
);
self::render_context_editor(
AccountMenu::CONTEXT_PAGE,
__( 'Account page sidebar', '4wp-account' ),
__( 'Left navigation on the logged-in account page.', '4wp-account' ),
array(
'forwp/account',
'[forwp_account]',
)
);
}
/**
* @param string $context header|page.
* @param string $title Panel title.
* @param string $description Panel description.
* @param string[] $shortcodes Shortcode hints.
*/
private static function render_context_editor( string $context, string $title, string $description, array $shortcodes ): void {
$sections = AccountMenu::get_sections( $context );
$prefix = self::field_prefix( $context );
?>
$link Saved link row. * @param bool $template JS template fragment. */ private static function render_custom_link_row( string $field_name, string $row_key, array $link, bool $template = false ): void { $id = $template ? '__INDEX__' : $row_key; $label = (string) ( $link['label'] ?? '' ); $url = (string) ( $link['url'] ?? '' ); $order = isset( $link['order'] ) ? (int) $link['order'] : 50; $enabled = ! array_key_exists( 'enabled', $link ) || ! empty( $link['enabled'] ); $target = ( ! empty( $link['target'] ) && '_blank' === $link['target'] ); $name = $field_name . '[' . $id . ']'; ?>