_migrate_image( int $post_id, string $type )
Migrate the attachment image id from the legacy post meta location to the WP core’s featured image.
Parameters Parameters
- $post_id
-
(int) (Required) WP_Post ID.
- $type
-
(string) (Required) Award type, either "achievement" or "certificate".
Return Return
(bool) true if there was an image to migrate, else false.
Source Source
File: includes/functions/updates/llms-functions-updates-600.php
function _migrate_image( $post_id, $type ) {
$image_migrated = false;
$image = get_post_meta( $post_id, "_llms_{$type}_image", true );
if ( $image ) {
set_post_thumbnail( $post_id, $image );
$image_migrated = true;
}
delete_post_meta( $post_id, "_llms_{$type}_image" );
return $image_migrated;
}
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
| Version | Description |
|---|---|
| 6.0.0 | Introduced. |