array( 'label' => __( 'General', 'postlinkly' ), 'sub' => __( 'Post types, statuses, and language options.', 'postlinkly' ), 'icon' => '', ), 'suggestion' => array( 'label' => __( 'Suggestion Engine', 'postlinkly' ), 'sub' => __( 'How candidate links are scored and ranked.', 'postlinkly' ), 'icon' => '', ), 'advanced' => array( 'label' => __( 'Advanced & Debug', 'postlinkly' ), 'sub' => __( 'Cache, batch size, logging, and uninstall options.', 'postlinkly' ), 'icon' => '', ), ); /** * Filters the sections on the Settings page. * * Each entry is keyed by a slug and holds `label`, `sub`, and `icon` (SVG * markup, passed through the admin icon allow-list). A section's fields are * printed by the `postlinkly_render_settings_tab_{slug}` action inside the * shared settings form. A section with `'custom' => true` is printed * outside that form, in full, by `postlinkly_render_settings_section_{slug}` * — for a section that saves through its own form and AJAX action. * * Insert before `advanced`, which is meant to stay last. * * @since 1.18.0 * * @param array> $sections Section definitions, in page order. */ $sections = apply_filters( 'postlinkly_settings_sections', $sections ); $sections = array_map( static fn( $section ): array => wp_parse_args( is_array( $section ) ? $section : array(), array( 'label' => '', 'sub' => '', 'icon' => '', 'custom' => false, ) ), is_array( $sections ) ? $sections : array() ); require __DIR__ . '/partials/page-header.php'; ?>
$section ) : if ( 'advanced' === $tab_key || ! empty( $section['custom'] ) ) { continue; } ?>

$section ) : if ( 'advanced' !== $tab_key && empty( $section['custom'] ) ) { continue; } if ( 'advanced' !== $tab_key ) : /** * Prints a custom Settings section in full: its card, its own * form, and its own save wiring. Fires only for sections * flagged `'custom' => true` in `postlinkly_settings_sections`. * * @since 1.18.0 * * @param array $section The section definition. */ do_action( 'postlinkly_render_settings_section_' . $tab_key, $section ); else : ?>

array( 'save' => __( 'Save changes', 'postlinkly' ), 'saving' => __( 'Saving…', 'postlinkly' ), 'saved' => __( 'Saved!', 'postlinkly' ), 'genericError' => __( 'An error occurred. Please try again.', 'postlinkly' ), 'settingsSaved' => __( 'Settings saved.', 'postlinkly' ), 'aiSaveFailed' => __( 'AI settings could not be saved.', 'postlinkly' ), 'aiHalfFailed' => __( 'General settings were saved, but the AI settings were not:', 'postlinkly' ), 'timeout' => __( 'The save timed out. The settings may not have been stored — reload to check.', 'postlinkly' ), 'unreachable' => __( 'The request never reached the server. A security plugin, proxy, or lost connection usually causes this.', 'postlinkly' ), 'forbidden' => __( 'Rejected as an expired or invalid security token (HTTP 403). Reload the page and save again — this normally means the page was open for a long time. If it repeats immediately after a reload, a security plugin or firewall is blocking admin-ajax.php.', 'postlinkly' ), 'tooLarge' => __( 'The server refused the submission as too large (HTTP 413). Excluded Posts and similar lists are the usual cause.', 'postlinkly' ), 'serverError' => __( 'The server errored while saving (HTTP 500). The PHP error log will name the cause.', 'postlinkly' ), 'saveFailedHttp' => __( 'Save failed (HTTP', 'postlinkly' ), ), ) ); require __DIR__ . '/partials/page-footer.php'; ?>