The Pods Framework is a Content Development Framework for WordPress - It lets you create and extend content types that can be used for any project. Add fields of various types we've built in, or add your own with custom inputs, you have total control.
Add code in a custom plugin or theme for importing some sample data into one of the custom pod types.
Call pods('b-pod')->import($my_test_data);
a. If debugging, line 10172 of the PodsAPI class should show the value of $this->pod being equal to null.
Data meant for b-pod will instead end up in a-pod
Screenshots / Screencast
No response
Possible Workaround
For a workaround i found that assigning the name of the desired pod directly to $my_pod->data->api->pod allows the data to be imported into the correct pod.
Description
When attempting to call
import
on a pods object, the provided data ends up getting assigned to the first pods type found sorted by title.On line 10172 of the PodsAPI class, it attempts to load the pod using the value stored in
$this->pod
. The problem I found is that the value of$this->pod
is null, as it appears that the pod variable is never assigned inside the api class. Instead of loading the desired pod type, it grabs the first one it finds. https://github.com/pods-framework/pods/blob/2b6e56a7e175bcb61e0b21664fc1064edf0ab5c2/classes/PodsAPI.php#L10172Version
2.8.8.1
Testing Instructions
pods('b-pod')->import($my_test_data);
a. If debugging, line 10172 of the PodsAPI class should show the value of $this->pod being equal to null.Screenshots / Screencast
No response
Possible Workaround
For a workaround i found that assigning the name of the desired pod directly to
$my_pod->data->api->pod
allows the data to be imported into the correct pod.Example:
Site Health Information
Pods Package
No response