i want to make a web that combines the wordpress and codeigniter. Something like, i want to load some views from wordpress to codeigniter.
I have followed a tutorial to manipulate the wp-includes/load.php
from a tutorial, now when i have updated the wordpress load.php i encountered error from accessing the web. The code below is from tutorial which it says, i need to update the load.php of wordpress
<?php
/** wp-includes/load.php */
/** Aproximately line 25 */
// Variables that shouldn't be unset
// Add whatever CI's cookie name or, '_SESSION'
$no_unset = array( 'GLOBALS', '_GET', '_POST', '_COOKIE', '_REQUEST', '_SERVER', '_ENV', '_FILES', 'table_prefix','ci_session' );
/** Approximately line 524 */
/** Add this function */
/**
* Applies Magic Quotes to the $_COOKIE global but ignores Codeigniter's Cookie
* @param string $value Value passed by array_walk function
* @param string $key Key passed by array_walk function
*/
function ci_ignore_magic_quotes($value,$key)
{
if($key != "ci_session")
{
stripslashes_deep($value);
}
}
/* Update this function */
/**
* Add magic quotes to $_GET, $_POST, $_COOKIE, and $_SERVER.
*
* Also forces $_REQUEST to be $_GET + $_POST. If $_SERVER, $_COOKIE,
* or $_ENV are needed, use those superglobals directly.
*
* @access private
* @since 3.0.0
*/
function wp_magic_quotes() {
// If already slashed, strip.
if ( get_magic_quotes_gpc() ) {
$_GET = stripslashes_deep( $_GET );
$_POST = stripslashes_deep( $_POST );
$_COOKIE = stripslashes_deep( $_COOKIE );
}
// Escape with wpdb.
$_GET = add_magic_quotes( $_GET );
$_POST = add_magic_quotes( $_POST );
array_walk($_COOKIE, 'ci_ignore_magic_quotes');
//$_COOKIE = add_magic_quotes( $_COOKIE );
$_SERVER = add_magic_quotes( $_SERVER );
// Force REQUEST to be GET + POST.
$_REQUEST = array_merge( $_GET, $_POST );
}
?>
Here is the error that i've got:
Fatal error: Uncaught Error: Call to undefined function wp_convert_hr_to_bytes() in C:\xampp\htdocseservation\wp-includes\default-constants.php:33 Stack trace: #0 C:\xampp\htdocseservation\wp-settings.php(41): wp_initial_constants() #1 C:\xampp\htdocseservation\wp-config.php(89): require_once('C:\\xampp\\htdocs...') #2 C:\xampp\htdocseservation\wp-load.php(37): require_once('C:\\xampp\\htdocs...') #3 C:\xampp\htdocseservation\wp-blog-header.php(13): require_once('C:\\xampp\\htdocs...') #4 C:\xampp\htdocseservation\index.php(17): require('C:\\xampp\\htdocs...') #5 {main} thrown in C:\xampp\htdocseservation\wp-includes\default-constants.php on line 33