Plugin Directory

Changeset 3241565


Ignore:
Timestamp:
02/17/2025 03:25:22 AM (13 months ago)
Author:
wpgrids
Message:

Release v1.2.92

Location:
ai-content-generation
Files:
61 added
3 edited

Legend:

Unmodified
Added
Removed
  • ai-content-generation/trunk/inc/data.php

    r3241564 r3241565  
    88add_action('plugins_loaded', 'wpwand_load_template_strings', 0);
    99
    10 function wpwand_load_template_strings() {
     10function wpwand_load_template_strings()
     11{
    1112    // Hardcode all possible template strings that could come from the API
    1213    $template_strings = array(
     
    3637        __('Facebook Post', 'wp-wand'),
    3738        __('Generate a highly engaging post for Facebook', 'wp-wand'),
    38        
     39
    3940        // Pro Templates
    4041        __('Meta Title', 'wp-wand'),
     
    126127function wpwand_templates()
    127128{
    128     wpwand_sync_transient();
     129
    129130    $all_prompts = get_option('wpwand_data');
    130131    $custom_data = get_option('wpwand_custom_data', []);
    131 
     132    wpwand_sync_transient();
    132133    if (get_option('wpwand_pro_activated') == 'activation') {
    133134        wpwand_sync_date();
     
    135136    }
    136137    if (isset($all_prompts['free']) && isset($all_prompts['pro'])) {
    137         // Translate the template strings
    138         foreach ($all_prompts as $type => $templates) {
    139             foreach ($templates as $key => $template) {
    140                 if (isset($template['title'])) {
    141                     $all_prompts[$type][$key]['title'] = __($template['title'], 'wp-wand');
    142                 }
    143                 if (isset($template['description'])) {
    144                     $all_prompts[$type][$key]['description'] = __($template['description'], 'wp-wand');
    145                 }
    146                 if (isset($template['prompt'])) {
    147                     $all_prompts[$type][$key]['prompt'] = __($template['prompt'], 'wp-wand');
    148                 }
    149             }
    150         }
     138
    151139        return array_merge($custom_data, $all_prompts['free'], $all_prompts['pro']);
    152140    }
    153141    return [];
    154142}
     143
    155144function wpwand_sync_date()
    156145{
    157     if(defined('DOING_AJAX')){
    158         if (!isset($_POST['nonce']) || !wp_verify_nonce(sanitize_text_field( wp_unslash( $_POST['nonce'] ) ), 'wpwand_global_nonce')) {
     146    if (defined('DOING_AJAX')) {
     147        if (!isset($_POST['nonce']) || !wp_verify_nonce(sanitize_text_field(wp_unslash($_POST['nonce'])), 'wpwand_global_nonce')) {
    159148            wp_send_json_error('Nonce verification failed.', 403);
    160149        }
     
    166155        wpwand_get_data(true);
    167156    }
    168 
    169 
    170157}
    171158add_action('wp_ajax_wpwand_sync_date', 'wpwand_sync_date');
     
    218205
    219206// Add a helper function to retrieve and translate the stored strings
    220 function wpwand_translate_template_string($string) {
     207function wpwand_translate_template_string($string)
     208{
    221209    if (empty($string)) {
    222210        return $string;
     
    230218        }
    231219    }
    232    
     220
    233221    return $string;
    234222}
     
    293281        'Vietnamese' => 'vi',
    294282    ];
    295 
    296283}
    297284
     
    397384
    398385// Add this new function
    399 function wpwand_register_template_strings() {
     386function wpwand_register_template_strings()
     387{
    400388    $templates = get_option('wpwand_data');
    401    
     389
    402390    if (!empty($templates) && is_array($templates)) {
    403391        foreach ($templates as $type => $type_templates) {
     
    421409// Add this action hook at the end of the file
    422410add_action('init', 'wpwand_register_template_strings');
    423 
  • ai-content-generation/trunk/readme.txt

    r3241564 r3241565  
    55Requires at least: 5.0
    66Tested up to:  6.7.2
    7 Stable Tag: 1.2.91
     7Stable Tag: 1.2.92
    88License: GPL-2.0+
    99License URI: http://www.gnu.org/licenses/gpl-2.0.txt
  • ai-content-generation/trunk/wp-wand.php

    r3241564 r3241565  
    55 * Plugin URI: https://wpwand.com/
    66 * Description: WP Wand is a AI content generation plugin for WordPress that helps your team create high quality content 10X faster and 50x cheaper. No monthly subscription required.
    7  * Version: 1.2.91
     7 * Version: 1.2.92
    88 * Author: WP Wand
    99 * Author URI: https://wpwand.com/
Note: See TracChangeset for help on using the changeset viewer.