Skip to content

Loaded starter content images from media library - #4537

Closed
girishpanchal30 wants to merge 2 commits into
developmentfrom
bugfix/4532
Closed

Loaded starter content images from media library#4537
girishpanchal30 wants to merge 2 commits into
developmentfrom
bugfix/4532

Conversation

@girishpanchal30

Copy link
Copy Markdown
Contributor

Summary

Upload starter content images and migrate the legacy starter content images to the media library, if they haven't been already.

Check before Pull Request is ready:

Closes #4532

@pirate-bot

pirate-bot commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Plugin build for a91b0b7 is ready 🛎️!

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses issue #4532, where Neve's Default starter-content hero/section images were embedded in published pages as theme-directory URLs ({{theme_uri}}assets/img/starter-content/folio-*.jpeg) and were never sideloaded into the Media Library — so they 404'd after a theme update that renamed/removed the bundled assets. The change sideloads those images into the Media Library and rewrites the published pages to point at the resulting attachment URLs, both for new publishes and via a one-time migration for already-published sites.

Changes:

  • Adds the five folio-* content images to the core starter-content attachments array so WordPress imports them into the Media Library.
  • On publish (after_publishsync_content_images), imports each content image (dedup via _customize_draft_post_name) and replaces the legacy theme-URL references in home/about/services/work pages with the attachment URLs.
  • Registers a one-time init migration (migrate_legacy_content_images, guarded by the neve_starter_content_migrated option) that repoints already-published starter pages.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
inc/compatibility/starter_content.php Adds content-image attachment definitions, sideload/dedup helper, per-page URL migration, publish-time sync, and a static one-time legacy migration; merges content images into the attachments array.
globals/migrations.php Hooks Starter_Content::migrate_legacy_content_images onto init to run the one-time migration.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread inc/compatibility/starter_content.php Outdated
Comment thread inc/compatibility/starter_content.php Outdated
Comment thread inc/compatibility/starter_content.php Outdated
@selul selul closed this Jul 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-checklist-complete The Pull Request checklist is complete. (automatic label) pr-checklist-skip Allow this Pull Request to skip checklist.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants