Created
December 8, 2018 08:38
-
-
Save eto4detak/ea585f51c88a680a29adb0bc9a12db78 to your computer and use it in GitHub Desktop.
wp php JSON
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 | |
public function __construct() | |
{ | |
add_action('print_footer_scripts', array($this,'print_script_addsdgsdgsd'), 99); | |
} | |
public function print_script_addsdgsdgsd() | |
{ | |
if( !empty($this->elements)){ | |
?> | |
<script type="text/javascript"> | |
var elements = JSON.parse('<?php print json_encode($this->elements)?>' ); | |
</script> | |
<?php | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment