Skip to content

Instantly share code, notes, and snippets.

View phoopee3's full-sized avatar

Jason Lawton phoopee3

View GitHub Profile
@phoopee3
phoopee3 / functions.php
Created March 16, 2022 21:02 — forked from sirbrillig/functions.php
Post file using wp_remote_post in WordPress
<?php
$local_file = 'file_path'; //path to a local file on your server
$post_fields = array(
'name' => 'value',
);
$boundary = wp_generate_password( 24 );
$headers = array(
'content-type' => 'multipart/form-data; boundary=' . $boundary,
);
@phoopee3
phoopee3 / cpt-nested.php
Created February 10, 2022 02:34 — forked from andreawetzel/cpt-nested.php
CPT Plugin
<?php
/*
Plugin Name: WI Verbs Nested Post Types
Plugin URI: https://wisconsinverbs.com
Description: Display Custom Post Types in a nested menu
Version: 1.0
Author: Andrea Roenning
Author URI: https://andrearoenning.com
License: GPL2
License URI: https://www.gnu.org/licenses/gpl-2.0.html
@phoopee3
phoopee3 / GraphQL Starred Repos with Pagination.md
Last active September 14, 2019 04:22 — forked from obahareth/README.md
GitHub GraphQL API Starred Repositories With Pagination

GitHub GraphQL API Starred Repositories Examples With Pagination

You can play with the GraphQL API live here. It's pretty nice and has autocompletion based on the GraphQL schema.

The first example gets your first 3 starred repos, the cursor values can be used for pagination.

Here's an example response from the first query:

{