Post-Migrator/services/wordpress/update-acf-images.go

21 lines
476 B
Go
Raw Normal View History

2024-05-21 21:15:43 +00:00
package wordpress
import (
"federated.computer/wp-sync-slowtwitch/utilities"
"strconv"
)
type UpdateAcfImages struct {
Acf AcfImages `json:"acf"`
}
type AcfImages struct {
PostImages []int `json:"post_images"`
}
func (parameters *UpdateAcfImages) Execute(baseUrl, user, pass string, postId int) error {
endpoint := baseUrl + "wp-json/wp/v2/posts/" + strconv.Itoa(postId)
_, err := utilities.PostHttpRequestToWordpress(endpoint, user, pass, parameters)
return err
}