Created
November 10, 2019 13:57
-
-
Save onliniak/103fde78185b359ae1fa5b5ec8acb974 to your computer and use it in GitHub Desktop.
Connect any php file to WordPress functions/database
This file contains 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 | |
include_once $_SERVER['DOCUMENT_ROOT'] . '/wp-config.php'; | |
global $wpdb; | |
$wpdb->get_var('Single row'); | |
$result = $wpdb->get_results('Multiple rows'); | |
foreach ( $result as $row ) | |
{ | |
var_dump($row); | |
echo $row->key; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment