You’re right…the figcaptions are encoded as html in $block['innerHTML']
. You could do sth. like $tmpArray = explode('</li>',$block['innerHTML']);
before your foreach
loop to split the HTML string into an array that matches your gallery items and inside the loop strip_tags($tmpArray[i]);
to strip away all html tags and only get the text string inside <figcaption></figcaption>
. You’ll only need to add a counter i
to your loop to have an index for the $tmpArray
.
Related Posts:
- Deleting images from gallery remain as attachment
- How select multiple document as like media gallery
- Custom icons in media library
- Bulk image importing from folders
- Can I Change the Media Upload Location for each user?
- Media changes not updating posts
- Whats wrong with my wp gallery?
- Pre-load images into a new users media gallery
- How to get all id_attachment with one loop?
- Append Media/Attachment IDs to Gallery Shortcode HTML Output
- Only current gallery images with get_attached_media
- How to Protect Uploads, if User is not Logged In?
- ZIP up all images displayed in a [gallery] and offer as download link
- Cleanup uploads folder, Media Library db structure
- Rendering the uploaded file in a wp.media object
- WordPress Media Manager 3.5 – default link to
- Use a separate custom table (not posts) to handle file upload data
- Linking a PDF as a downloadable document
- How to call WP3.5 Media Library manager?
- Failed to import media from a local wordpress site to a live one
- Is is possible to crop an image after uploading
- Image dimensions same as image size
- PHP/Manual use of images? – 2 Questions
- Filter what image sizes get generated
- Use Media Library to manage galleries like Nextgen (with folders, albums, collections, tags, categories, terms…)
- Change default tab of media manager
- How to make a page template to list all galleries?
- Is email post notify visitor on new media upload possible?
- How to set additional parameter in wp.media?
- get total number of images from media using xml-rpc
- Audio Playlist : How to bind events for “track change”, “track end”?
- How do I control video media display sizing with native wordpress player
- Upload mobi and epub file in the MEDIA of WP
- Handle lots of images within the media uploader / selector
- Image archive without date
- FTP files directly to Media Library wp-content\uploads
- How to get an image url from media library
- Uploading Media gives error “Missing a temporary folder.”
- Disable mouse image resizing in editor
- Organizing media uploads
- How to make a customized “Create Gallery” tab in the ‘Add Media’ window?
- How to insert an Audio Player in a Post or Page?
- 3.5 Media Manager – callout in metaboxes
- Front end wp_editor not rendering audio/video links
- Force WordPress, themes & plugins into using defined sizes
- Audio file’s length (duration) is missing from Attachment Details in Media Library [closed]
- Media Manager: refresh library after new selection
- WordPress Media Image Manager — Creating Lots and Lots of Odd Sized Images
- Large image size stuck on old value, even for new images
- Can I force all uploaded images to be reduced in quality?
- Cannot upload anything via wordpress
- Rotating image does not work for custom image sizes
- Audio Player for MP3 Files for WordPress
- Rebuild the entire WordPress uploads folder
- Media Gallery Upload photo incorrect way like glitch
- See List View – or Image titles- of Media Library when “Add Media” button is used
- How to hide some specific attachments using post meta from media library
- adding images column to admin edit columns not working for SVG
- How to extend an existing (Gutenberg) block
- Importing Media IDs but not related attachment
- Allow Editor Role to Edit Media
- Ho to add “Create Slider” option to default “Add Media” popup?
- WordPress media file link with fancybox
- How to open a Media Uploader dialog with a particular image is selected
- How to run custom JavaScript code on gallery attachment image selection
- Editing image dimension – to edit the main image file
- Force image crop size in media editor
- Set Maximum Width for an uploaded image
- Too slow Image upload in WordPress Media Library as image number increases
- Use staging media files on development site in WordPress
- Getting a specific value out of array using get_attached_media
- WordPress 3.6 native player is not responsive?
- Thumbnail images chopped off but not cropped to exact dimensions
- How to disable (and hide) the Media Library for certain users?
- Specific folder and no thumbnail generation for media_sideload_image
- Publish / unpublish media items in the media library
- Use media files from a different server just for one custom type
- Media isn’t showing in WordPress library but is available in uploads folder
- WP REST API Create media return Timeout Gateway in response, but media created
- Media Library not loading
- How do I get WordPress to create resizes of a supplied default image in a theme?
- Creating multiple instances of Media Uploader
- Handle image file and save it to media
- TwentySeventeen $content_width not updated in admin
- Disable wordpress gif compression?
- wordpress doesnt add media.css file
- Change default ‘file not supported’ error message
- How to create different media uploader frames / filter library depending on a custom action
- Organising and display thousands of photos in media library
- cant able to upload media to my wordpress blog
- ACF Gallery with Media Categories – how do display categories and sort
- Change image in media library at specific time
- Elegant way to signify inheritance and relationship between posts
- Media Player gone on front end
- Why does uploading a media file a second time restore older version?
- Import of 200+ sermons
- add file name column to media library to sort by
- After import, oEmbeds non-functional until manual republish
- Add link to media files in backend and modify linked images in the frontend
- Looking for a way to insert PDF image preview in TinyMCE