Plugin Directory

Changeset 3045542

Timestamp:
03/05/2024 10:23:48 AM (5 months ago)
Author:
soportecibeles
Message:

fix: path changes

Location:
cibeles-ai/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cibeles-ai/trunk/cibeles-ai.php

    r3036333 r3045542  
    3131];
    3232
     33
     34
     35
    3336if ( is_admin() ) {
    3437    require_once $cibelesAiPlugin['path'] . 'init.php';
    3538    require_once $cibelesAiPlugin['path'] . 'functions.php';
    3639    require_once $cibelesAiPlugin['path'] . 'options.php';
     40
     41
     42
     43
     44
     45
     46
     47
     48
     49
     50
     51
     52
     53
     54
     55
     56
    3757}
    3858
  • cibeles-ai/trunk/init.php

    r3045536 r3045542  
    266266}
    267267
    268 //Mejora la carga de la página en la vista de post haciendo una precarga de la imagen webp
    269 add_action('wp_head', 'preload_post_thumbnail_in_webp_format_if_exists');
    270 
    271 function preload_post_thumbnail_in_webp_format_if_exists(){
    272     if (has_post_thumbnail() && is_single()) {
    273         $attachment_id = get_post_thumbnail_id();
    274         $attachment_path = get_attached_file($attachment_id);
    275         $attachment_path_webp = $attachment_path . '.webp';
    276         if (file_exists($attachment_path_webp)) {
    277             $upload_dir = wp_upload_dir();
    278             $attachment_url_webp = str_replace($upload_dir['basedir'], $upload_dir['baseurl'], $attachment_path_webp);
    279             echo '<link rel="preload" as="image" href="' . esc_url($attachment_url_webp) . '">';
    280         }
    281     }
    282 }
    283 
Note: See TracChangeset for help on using the changeset viewer.