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
body: SingleChildScrollView(
child: Column(
children: <Widget>[
Container(
child: GestureDetector(
child:
Image.network(
postOne.imageUrl,
fit: BoxFit.fitWidth,
height: MediaQuery
@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,
) );
}
});.
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 );
@izzygld
izzygld / wp-graphql-popular-posts-connection.php
Created October 25, 2020 08:43
wp-graphql-popular-posts-connection.php
@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 / saves-drafts-posts.php
Created June 21, 2020 13:57
Now pending posts get displayed to anyone and private posts are still only visible to admins
/*
* How to make draft posts or posts in review accessible via full url / slug.
* Source: - https://wordpress.stackexchange.com/questions/218168/how-to-make-draft-posts-or-posts-in-review-accessible-via-full-url-slug
*/
function auto_save_post_status( $post_id, $post, $update ) {
if( $post->post_status == "draft" && ! $post->post_name ) {
remove_action( 'save_post', 'auto_save_post_status', 20, 3 );
@izzygld
izzygld / se-schema-parent.php
Created February 18, 2020 13:24
Structured data - wordpress theme
// Display Tag code
function ahmedkaludi_structured_data_keyword() {
if ( is_single() ) {
$tags = '"keywords" : [' . strip_tags(get_the_tag_list('"','", "','"')) . ']';
} else { }
echo $tags;
}
function ahmedkaludi_structured_data_output() {
@izzygld
izzygld / class-config.php
Created December 4, 2019 14:16
acf wpgraphql types meta
<?php
/**
* Config for WPGraphQL ACF
*
* @package wp-graphql-acf
*/
namespace WPGraphQL\ACF;
use WPGraphQL\Data\DataSource;