Skip to content

Instantly share code, notes, and snippets.

View fyodorovich's full-sized avatar

Malcolm Fitzgerald fyodorovich

View GitHub Profile
@fyodorovich
fyodorovich / README.md
Created October 26, 2021 04:57 — forked from hakre/README.md
Iterators for PHP XMLReader for ease of parsing

Iterators for PHP XMLReader for ease of parsing

Change Log:

  • 0.1.10 maintenance release with fixes.

  • 0.1.9 maintenance release with fixes. added XMLReaderNode::expand().

  • 0.1.8 maintenance release with fixes.

@fyodorovich
fyodorovich / custom-types-and-fields.php
Created February 1, 2021 04:26 — forked from kosso/custom-types-and-fields.php
An example Wordpress (4.7+) plugin to create custom post types with custom taxonomies and custom meta fields, including exposing these to the REST API and adding custom columns in admin.
<?php
/**
* Plugin Name: Custom Post Types Example
* Description: An example plugin to create custom post types with custom taxonomies and custom meta fields, including exposing to the REST API.
* Plugin URI: http://kosso.co.uk
* Version: 1.0.0
* Author: Kosso
* Author URI: http://kosso.co.uk
* License: GPLv2
* Network: true
@fyodorovich
fyodorovich / app-passwords-client-demo.php
Created January 25, 2021 23:18 — forked from TimothyBJacobs/app-passwords-client-demo.php
App Passwords Client Demo Plugin
<?php
declare( strict_types=1 );
/*
* Plugin Name: Demo App Passwords Client
*/
namespace TimothyBJacobs\AppPasswordsClientDemo;
const META_KEY = '_app_passwords_client_demo_creds';
@fyodorovich
fyodorovich / client.js
Created December 9, 2020 21:37 — forked from georgestephanis/client.js
This is an example client app to integrate with the WordPress 5.6 Application Passwords system. It walks the user through authenticating, and then queries and enumerates all users on the site.
(function($){
const $root = $( '#root' );
const $stage1 = $( '.stage-1', $root );
const $stage2 = $( '.stage-2', $root );
// If there's no GET string, then no credentials have been passed back. Let's get them.
if ( ! window.location.href.includes('?') ) {
// Stage 1: Get the WordPress Site URL, Validate the REST API, and Send to the Authentication Flow
const $urlInput = $( 'input[type=url]', $stage1 );