Browse Source

:sparkles: add caption and description to api

tags/1.0.2^2
J 3 years ago
parent
commit
72f52c067f
2 changed files with 4 additions and 1 deletions
  1. 1
    0
      .drone.yml
  2. 3
    1
      plugins/cia-endpoints/includes/reformat-blocks.php

+ 1
- 0
.drone.yml View File

64
     status:
64
     status:
65
         # Only runs if the first pipeline was fully successful
65
         # Only runs if the first pipeline was fully successful
66
         - success
66
         - success
67
+        # Only runs on the master branch
67
     branch:
68
     branch:
68
         - master
69
         - master
69
 
70
 

+ 3
- 1
plugins/cia-endpoints/includes/reformat-blocks.php View File

42
             // Format for lightbox wants an object
42
             // Format for lightbox wants an object
43
             $parse_images[$id] = [
43
             $parse_images[$id] = [
44
                 'src' => $image->getAttribute('src'),
44
                 'src' => $image->getAttribute('src'),
45
-                'title' => $image->getAttribute('alt'),
45
+                'alt' => $image->getAttribute('alt'),
46
+                'title' => wp_get_attachment_caption($id),
47
+                'description' => get_the_excerpt($id)
46
             ];
48
             ];
47
         }
49
         }
48
         return $parse_images;
50
         return $parse_images;

Loading…
Cancel
Save