21 lines
499 B
Go
21 lines
499 B
Go
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
|
|
}
|