Skip to content

Instantly share code, notes, and snippets.

View kenpoc4's full-sized avatar
🏠
Working from home

Kenny Poncio kenpoc4

🏠
Working from home
View GitHub Profile
@mtx-z
mtx-z / wp-bootstrap4.4-pagination.php
Last active April 4, 2023 12:55
Wordpress 5.4 Bootstrap 4.4 pagination (with custom WP_Query() and global $wp_query support) (UPDATED for Bootstrap 5: https://gist.github.com/mtx-z/af85d3abd4c19a84a9713e69956e1507)
<?php
/**
* @param WP_Query|null $wp_query
* @param bool $echo
* @param array $params
*
* @return string|null
*
* UPDATE for Bootstrap 5.0: https://gist.github.com/mtx-z/af85d3abd4c19a84a9713e69956e1507
*
<?php
$request_url = 'http://localhost/wp-json/list_product_stock/v1/list-product-stock/';
$credentials = array();
$credentials = array( 'username: basic_user', 'password: password_for_the_user' );
$curl_handle = curl_init( );
curl_setopt( $curl_handle, CURLOPT_URL, $request_url );
curl_setopt( $curl_handle, CURLOPT_CONNECTTIMEOUT, 0 );
curl_setopt( $curl_handle, CURLOPT_TIMEOUT, 15 );