Skip Navigation

[Gelöst] Rest Api v2 does not work with my custom post type

This support ticket is created vor 5 Jahren, 5 Monaten. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

Dieses Thema enthält 18 Antworten, hat 3 Stimmen.

Zuletzt aktualisiert von Christian Cox vor 5 Jahren, 5 Monaten.

Assistiert von: Christian Cox.

Author
Artikel
#1286053
toolset_post_redered_template.jpg

Great. Yes now it can be found in the data model as post-rendered-template (screenshot).
How can I select post-rendered-template and add ist into my function?

<script>
$(function() {
$.getJSON('versteckter Link', function(alldata) {
var contentElm = alldata.content.rendered
$(contentElm).appendTo("#userdata");
});
});
</script>

I tried to replace "content" with "post-rendered-template".
Without success.

#1286469

In basic Javascript you can use the array syntax to access an object property.

var contentElm = alldata['post-rendered-template'];
#1287065

Thank you, Christian, for your patience and your targeted support.
It Works!
Best regards
Uwe

#1287625

You're welcome