- Introduced Groq_AI_Logs_Admin class to manage AI logs in the admin panel, including log viewing and detail rendering. - Created Groq_AI_Settings_Renderer class for rendering settings fields in a structured manner. - Implemented Groq_AI_Term_Admin_Base class to handle term-related functionalities, including term page registration and bulk actions for term descriptions. - Enhanced term management with AJAX support for generating term descriptions and handling Rank Math integration.
47 lines
1013 B
PHP
47 lines
1013 B
PHP
<?php
|
|
|
|
abstract class Groq_AI_Admin_Base {
|
|
/** @var Groq_AI_Product_Text_Plugin */
|
|
protected $plugin;
|
|
|
|
public function __construct( Groq_AI_Product_Text_Plugin $plugin ) {
|
|
$this->plugin = $plugin;
|
|
}
|
|
|
|
protected function get_page_url( $slug = 'groq-ai-product-text', $args = [] ) {
|
|
$slug = sanitize_key( (string) $slug );
|
|
$url = add_query_arg(
|
|
[
|
|
'page' => $slug,
|
|
],
|
|
admin_url( 'options-general.php' )
|
|
);
|
|
|
|
if ( ! empty( $args ) ) {
|
|
$url = add_query_arg( $args, $url );
|
|
}
|
|
|
|
return $url;
|
|
}
|
|
|
|
protected function current_user_can_manage() {
|
|
return current_user_can( 'manage_options' );
|
|
}
|
|
|
|
protected function enqueue_admin_styles() {
|
|
wp_enqueue_style(
|
|
'groq-ai-settings',
|
|
plugins_url( 'assets/css/admin.css', GROQ_AI_PRODUCT_TEXT_FILE ),
|
|
[],
|
|
GROQ_AI_PRODUCT_TEXT_VERSION
|
|
);
|
|
|
|
wp_enqueue_style(
|
|
'groq-ai-settings-extra',
|
|
plugins_url( 'assets/css/settings.css', GROQ_AI_PRODUCT_TEXT_FILE ),
|
|
[ 'groq-ai-settings' ],
|
|
GROQ_AI_PRODUCT_TEXT_VERSION
|
|
);
|
|
}
|
|
}
|