Post-Migrator/services/wordpress/update-acf-related-posts.go

21 lines
499 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 UpdateAcfRelatedPosts struct {
Acf AcfRelatedPosts `json:"acf"`
}
type AcfRelatedPosts struct {
PostIds []int `json:"related_posts"`
}
func (parameters *UpdateAcfRelatedPosts) 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
}