Skip to content

Instantly share code, notes, and snippets.

View izzygld's full-sized avatar
❤️
it's nice to be important but it's important to be nice. 🤓

izzy goldman izzygld

❤️
it's nice to be important but it's important to be nice. 🤓
View GitHub Profile
@izzygld
izzygld / learndash-graphql.php
Created August 17, 2020 14:34
Replace REST API with @wpgraphql with @apollographql client.
<?php
add_filter( 'register_post_type_args', function( $args, $post_type ) {
if ( 'sfwd-courses' === $post_type ) {
$args['show_in_graphql'] = true;
$args['graphql_single_name'] = 'course';
$args['graphql_plural_name'] = 'courses';
}
@izzygld
izzygld / WP-Graphql-Nav-Menu-Readme.md
Last active July 18, 2023 17:04
WP-Graphql Nav Menu Documentation

WP Grahql - Nav Menu

Implements navigation menu support with two new types: Menu and MenuItem. Each have singular and plural root queries. MenuItems are connected to both Menus and to themselves—this allows for the implementation of childItems (hierarchical nav menu queries):

Query{
  menus( location: MAIN ) {
    edges {
      node {
        id
@izzygld
izzygld / wp-graphql-popular-posts-connection.php
Created October 25, 2020 08:43
wp-graphql-popular-posts-connection.php
body: SingleChildScrollView(
child: Column(
children: <Widget>[
Container(
child: GestureDetector(
child:
Image.network(
postOne.imageUrl,
fit: BoxFit.fitWidth,
height: MediaQuery
@izzygld
izzygld / Pagination.vue
Last active May 27, 2022 01:56
Wp Graphql Vue Pagination
1. Regular post query with pagination fields
2. include the Pagination Component
3. The actual pagination.
----------------
1. const postsQuery = gql`
query GetAllPosts ($first: Int, $last: Int, $endCursor: String, $startCursor: String) {
posts(first:$first last:$last after:$endCursor before:$startCursor) {
@izzygld
izzygld / acf_options_page.php
Last active November 1, 2021 09:37
Acf Options page
add_action('acf/init', function () {
if ( function_exists( 'acf_add_options_sub_page' ) ){
acf_add_options_sub_page( array(
'title' => 'Photo Settings',
'parent' => 'edit.php?post_type=photo',
'capability' => 'manage_options',
'show_in_graphql' => true,
) );
}
});.
@izzygld
izzygld / Wysiwyg.vue
Created January 9, 2019 14:06
Adding a “show html” button in Quill (Wysiwyg).
<template>
<div>
<vue-editor v-model="content" ref="editor" :editor-options="toolbarOptions" @text-change="updateValue" useCustomImageHandler @imageAdded="uploadImage"></vue-editor>
</div>
</template>
<script>
import Vue from "vue";
import axios from 'axios'
let VueEditor, Quill;
add_filter( 'the_content', 'airpets_terms_nav' );
function airpets_terms_nav($content) {
if( is_page_template( 'page-terms.php' ) ):
$menu = '<div id="top" class="anchor-menu"><ul class="menu">';
$blocks_arr = parse_blocks( get_the_content() );
foreach( $blocks_arr as $block ):
@izzygld
izzygld / WpMedia.vue
Created April 8, 2021 08:14
WpImage.vue
<template>
<figure :class="classes">
<div
class="sizer"
:style="sizerStyles"
>
<img
v-if="parsedSrc"
ref="img"
class="media media-image"
<?php
add_filter( "gform_confirmation_anchor",function() {} );
//For backwards compatibility, load wordpress if it hasn't been loaded yet
//Will be used if this file is being called directly
if(!class_exists("RGForms")){
for ( $i = 0; $i < $depth = 10; $i++ ) {
$wp_root_path = str_repeat( '../', $i );