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