Last active
August 29, 2015 14:25
-
-
Save etki/7e3b95f116907dc1efc4 to your computer and use it in GitHub Desktop.
A loop for WordPress wp-forms plugin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class WP_Form implements WP_Form_Aggregate, WP_Form_Attributes_Interface | |
{ | |
public function getElements() | |
{ | |
$elements = []; | |
foreach ($this->elements as $element) { | |
$dataBuffer = $element->getAttributes(); | |
if ($element instanceof WP_Form_Aggregate) { | |
$dataBuffer['elements'] = $element->getElements(); | |
} | |
$elements[] = $dataBuffer; | |
} | |
return $elements; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment