This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {createPersistedQueryLink} from '@apollo/client/link/persisted-queries'; | |
import {HttpLink} from "@apollo/client"; | |
import {sha256} from 'crypto-hash'; | |
const linkChain = createPersistedQueryLink({ sha256 }).concat( | |
new HttpLink({ uri: process.env.WPGRAPHQL_URL }), | |
); | |
class PersistedQueriesPlugin { | |
apply({ addFilter }) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// NOTE, THIS IS VERY EXPERIMENTAL. TAKE THIS WITH A BIG GRAIN OF SALT, BUT DO WHAT YOU WILL WITH IT. | |
register_graphql_object_type("ThemeSettings", [ | |
'description' => 'Theme Settings', | |
'fields' => [ | |
'primaryColor' => [ | |
'type' => 'string', | |
'description' => 'Primary Color', | |
'resolve' => function ($settings) { | |
$colors = $settings->settings->color->palette->theme; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs') | |
const path = require('path') | |
// for CRA-2 un-comment line 5 and comment line 6 | |
// const assetManifest = require('./build/asset-manifest.json') | |
const assetManifest = require('./build/asset-manifest.json')[files] | |
const indexFilePath = path.join(__dirname, 'build/index.html') | |
const BUILD_PATH = path.join(__dirname, 'build/useful-asset-manifest.json') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Add sub options page with a custom post id | |
*/ | |
if( function_exists('acf_add_options_page') ) { | |
acf_add_options_sub_page(array( | |
'page_title' => 'CSV Sync', | |
'menu_title' => 'CSV Sync', | |
'parent_slug' => 'users.php', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: YOUR PLUGIN NAME | |
*/ | |
include( dirname( __FILE__ ) . '/lib/requirements-check.php' ); | |
$your_plugin_requirements_check = new YOUR_PREFIX_Requirements_Check( array( | |
'title' => 'YOUR PLUGIN NAME', | |
'php' => '5.4', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
session_start(); | |
$code = $_GET['code']; | |
$url = 'https://github.com/login/oauth/access_token'; | |
$client_id = 'xxxxxxxxxxxxxxxxxxxxxxx'; | |
$client_secret = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'; | |
// echo $code; | |
$postdata = http_build_query( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// This can be found in the Symfony\Component\HttpFoundation\Response class | |
const HTTP_CONTINUE = 100; | |
const HTTP_SWITCHING_PROTOCOLS = 101; | |
const HTTP_PROCESSING = 102; // RFC2518 | |
const HTTP_OK = 200; | |
const HTTP_CREATED = 201; | |
const HTTP_ACCEPTED = 202; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App; | |
use Illuminate\Notifications\Notifiable; | |
use Illuminate\Auth\Authenticatable; | |
use Illuminate\Auth\Passwords\CanResetPassword; | |
use Illuminate\Foundation\Auth\Access\Authorizable; | |
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract; | |
use Illuminate\Contracts\Auth\Access\Authorizable as AuthorizableContract; | |
use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getLogoutUrl($redirectUrl = ''){ | |
if(!$redirectUrl) $redirectUrl = site_url(); | |
$return = str_replace("&", '&', wp_logout_url($redirectUrl)); | |
return $return; | |
} | |
/** | |
* Bypass logout confirmation on nonce verification failure | |
*/ | |
function logout_without_confirmation($action, $result){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Init Masonry | |
var $grid = jQuery('.facetwp-template').masonry({ | |
percentPosition: true, | |
columnWidth: '.grid-sizer', | |
itemSelector: '.grid-item' | |
}); | |
// Reload and update on FacetWP load | |
jQuery(document).on('facetwp-loaded', function() { | |
$grid.masonry('reloadItems') |
NewerOlder