Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter gyunduz

    (@gyunduz)

    I solved the problem, added code [sliderpro id=”3″ allow_cache=”false”] without any functions.php. Thanks

    Thread Starter gyunduz

    (@gyunduz)

    I tried this code

    add_action('save_post', 'clear_slider_cache');
    
    function clear_slider_cache() {
    global $wpdb;
    $prefix = $wpdb->prefix;
    
    $wpdb->query( "DELETE FROM" . $prefix . "options WHERE option_name LIKE '%sliderpro_cache'" );
    }

    functions.php saved successful.
    But nothing happens, cache is not cleared and now I receive this in error.log:

    [11-Feb-2022 13:30:49 UTC] WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'WHERE option_name LIKE '%sliderpro_cache'' at line 1 for query DELETE FROMwQQp_options WHERE option_name LIKE '%sliderpro_cache' made by require('wp-blog-header.php'), wp, WP->main, WP->parse_request, do_action_ref_array('parse_request'), WP_Hook->do_action, WP_Hook->apply_filters, rest_api_loaded, WP_REST_Server->serve_request, WP_REST_Server->dispatch, WP_REST_Server->respond_to_request, WP_REST_Posts_Controller->update_item, wp_update_post, wp_insert_post, do_action('post_updated'), WP_Hook->do_action, WP_Hook->apply_filters, wp_save_post_revision, _wp_put_post_revision, wp_insert_post, do_action('save_post'), WP_Hook->do_action, WP_Hook->apply_filters, clear_slider_cache
    [11-Feb-2022 13:30:49 UTC] WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'WHERE option_name LIKE '%sliderpro_cache'' at line 1 for query DELETE FROMwQQp_options WHERE option_name LIKE '%sliderpro_cache' made by require('wp-blog-header.php'), wp, WP->main, WP->parse_request, do_action_ref_array('parse_request'), WP_Hook->do_action, WP_Hook->apply_filters, rest_api_loaded, WP_REST_Server->serve_request, WP_REST_Server->dispatch, WP_REST_Server->respond_to_request, WP_REST_Posts_Controller->update_item, wp_update_post, wp_insert_post, do_action('save_post'), WP_Hook->do_action, WP_Hook->apply_filters, clear_slider_cache
    Thread Starter gyunduz

    (@gyunduz)

    Thanks for quick support,

    but when I try to add this code I receive error:
    (syntax error, unexpected ‘WHERE’ (T_STRING), expecting ‘)’)

    in this line:

    $wpdb->query( “DELETE FROM ” . $prefix . “options WHERE option_name LIKE ‘%sliderpro_cache%’” );

Viewing 3 replies - 1 through 3 (of 3 total)