$top_n,
'orderby' => $orderby,
'include_cats' => array_values( array_filter( $include ) ),
'exclude_cats' => array_values( array_filter( $exclude ) ),
)
);
wp_safe_redirect( Lltxt_Admin_Page::redirect_url( 'catalog', 'catalog_saved' ) );
exit;
}
/**
* Render the controls.
*
* @return void
*/
public static function render() {
$code = isset( $_GET['lltxt_notice'] ) ? sanitize_key( wp_unslash( $_GET['lltxt_notice'] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended
if ( 'catalog_saved' === $code ) {
echo '
' . esc_html__( 'Catalog settings saved. Regenerate files from the Files tab to apply.', 'agentic-commerce-llms-txt' ) . '
';
}
$cfg = get_option( 'lltxt_catalog_settings', array() );
$cfg = is_array( $cfg ) ? $cfg : array();
$top_n = isset( $cfg['top_n'] ) ? (int) $cfg['top_n'] : 100;
$orderby = isset( $cfg['orderby'] ) ? $cfg['orderby'] : 'total_sales';
$include = isset( $cfg['include_cats'] ) ? (array) $cfg['include_cats'] : array();
$exclude = isset( $cfg['exclude_cats'] ) ? (array) $cfg['exclude_cats'] : array();
$cats = Lltxt_Catalog_Reader::get_categories();
$orderby_opts = array(
'total_sales' => __( 'Best selling (total sales)', 'agentic-commerce-llms-txt' ),
'date' => __( 'Newest first', 'agentic-commerce-llms-txt' ),
'title' => __( 'Title (A–Z)', 'agentic-commerce-llms-txt' ),
'price' => __( 'Price', 'agentic-commerce-llms-txt' ),
);
?>
'
. esc_html__( 'SEO source for product descriptions:', 'agentic-commerce-llms-txt' )
. ' ' . esc_html( $src ) . '';
}
}
}