Skip to content

Instantly share code, notes, and snippets.

aaronhayes /
Last active October 3, 2022 15:58
Common Currencies Array JSON
mahlamusa / extend-wp-rest-api.php
Last active June 1, 2023 10:38
Extend WordPress REST API with custom rest fields and endpoints
View extend-wp-rest-api.php
* Register custom rest fields
add_action( 'rest_api_init', 'register_custom_fields' );
* Register rest fields and endpoint
simonhamp / AppServiceProvider.php
Last active September 25, 2023 12:34
A pageable Collection implementation for Laravel
View AppServiceProvider.php
namespace App\Providers;
use Illuminate\Support\Collection;
use Illuminate\Pagination\LengthAwarePaginator;
class AppServiceProvider extends ServiceProvider
public function boot()
charleslouis / custom-search-acf-wordpress.php
Last active June 29, 2023 09:39
PHP - Wordpress - Search - wordpress custom search function that encompasses ACF/advanced custom fields and taxonomies and split expression before request
View custom-search-acf-wordpress.php
* [list_searcheable_acf list all the custom fields we want to include in our search query]
* @return [array] [list of custom fields]
function list_searcheable_acf(){
$list_searcheable_acf = array("title", "sub_title", "excerpt_short", "excerpt_long", "xyz", "myACF");
return $list_searcheable_acf;
justinhernandez / gist:630770
Created October 17, 2010 11:39
pretty array export for var_export
View gist:630770
function pretty_var($myArray){
print str_replace(array("\n"," "),array("<br>","&nbsp;"), var_export($myArray,true))."<br>";