Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
038235a
Add REST endpoint to retrieve excerpt target field
faisal-alvi Aug 8, 2025
962a072
Save to target field upon successful generation
faisal-alvi Aug 8, 2025
8acc4f4
Include target field information in the inline script
faisal-alvi Aug 8, 2025
fd187a5
Include configuration options for saving generated excerpts
faisal-alvi Aug 8, 2025
38cd528
Add target field settings for excerpt generation
faisal-alvi Aug 8, 2025
619b582
Add rendering functionality for target field settings in excerpt gene…
faisal-alvi Aug 8, 2025
da56c72
Add target field configuration options for excerpt generation
faisal-alvi Aug 8, 2025
c277806
Sanitize target field settings in excerpt generation configuration
faisal-alvi Aug 8, 2025
255ce8f
Add default target field type for existing installations in excerpt g…
faisal-alvi Aug 8, 2025
26fc6c6
Add functionality to save generated excerpts to various target fields
faisal-alvi Aug 8, 2025
a88e457
Add method to retrieve current value from target field in excerpt gen…
faisal-alvi Aug 8, 2025
1907609
Add method to retrieve available ACF fields for target field selector…
faisal-alvi Aug 8, 2025
e71a690
Add method to retrieve target field information for JavaScript in exc…
faisal-alvi Aug 8, 2025
c601836
Add method to check if ACF is available and active in excerpt generation
faisal-alvi Aug 8, 2025
f9a0895
Add notification for target field when excerpt is generated, with aut…
faisal-alvi Aug 8, 2025
0de0232
Implement target field value retrieval on component mount in excerpt …
faisal-alvi Aug 8, 2025
d07c265
Add SelectControl for target field selection in excerpt generation se…
faisal-alvi Aug 8, 2025
a83c6f9
Add REST API callback to retrieve target field value in excerpt gener…
faisal-alvi Aug 8, 2025
f5a65d2
Ensure proper handling of generated content in excerpt generation
faisal-alvi Aug 8, 2025
7835411
Improve state management and update UI labels
faisal-alvi Aug 8, 2025
316ca46
Add REST API endpoint to retrieve target field settings and enhance p…
faisal-alvi Aug 8, 2025
bb9e711
Enhance excerpt generation panel by adding custom field display and e…
faisal-alvi Aug 8, 2025
2fb4cb9
Classic Editor: Dynamically handle custom field settings and update U…
faisal-alvi Aug 8, 2025
4883e45
Add ACF fields retrieval method to settings and include in settings a…
faisal-alvi Aug 8, 2025
7156519
Update messages to differentiate between ACF fields and custom fields
faisal-alvi Aug 8, 2025
8e0e3e1
eslint fixes
faisal-alvi Aug 8, 2025
784c80b
few more eslint fixes
faisal-alvi Aug 8, 2025
f9d66a6
phpcs fixes
faisal-alvi Aug 8, 2025
33d4f87
phpstan issues fixed,
faisal-alvi Aug 8, 2025
27fd51b
Update plugin-check workflow to ignore specific discouraged function …
faisal-alvi Aug 8, 2025
0397277
Update version annotations to 3.6.0
faisal-alvi Aug 8, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/plugin-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,4 @@ jobs:
exclude-checks: 'plugin_readme,plugin_updater' # Plugin isn't on .org so excluding these for now.
exclude-directories: 'assets,dist,vendor'
ignore-warnings: true
ignore-codes: 'PluginCheck.CodeAnalysis.DiscouragedFunctions.load_plugin_textdomainFound'
44 changes: 44 additions & 0 deletions includes/Classifai/Admin/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ public function admin_enqueue_scripts( $hook_suffix ) {
'postStatuses' => get_post_statuses_for_language_settings(),
'isEPinstalled' => is_elasticpress_installed(),
'nluTaxonomies' => $this->get_nlu_taxonomies(),
'acfFields' => $this->get_acf_fields(),
);

wp_add_inline_script(
Expand Down Expand Up @@ -218,6 +219,49 @@ public function get_nlu_taxonomies(): array {
return apply_filters( 'classifai_settings_ibm_watson_nlu_taxonomies', $taxonomies );
}

/**
* Get ACF fields if ACF is active.
*
* @since 3.6.0
*
* @return array
*/
public function get_acf_fields(): array {
$acf_fields = array();

// Check if ACF is active.
if ( ! function_exists( 'acf_get_field_groups' ) ) {
return $acf_fields;
}

// Get all ACF field groups.
$field_groups = acf_get_field_groups();

if ( empty( $field_groups ) ) {
return $acf_fields;
}

// Loop through field groups and get their fields.
foreach ( $field_groups as $field_group ) {
$fields = function_exists( 'acf_get_fields' ) ? acf_get_fields( $field_group ) : array();

if ( ! empty( $fields ) ) {
foreach ( $fields as $field ) {
// Only include text, textarea, and wysiwyg fields for excerpt generation.
if ( in_array( $field['type'], array( 'text', 'textarea', 'wysiwyg' ), true ) ) {
$acf_fields[] = array(
'key' => $field['key'],
'name' => $field['name'],
'label' => $field['label'],
'type' => $field['type'],
);
}
}
}
}

return $acf_fields;
}

/**
* Get the settings.
Expand Down
Loading
Loading