Skip to content

Instantly share code, notes, and snippets.

@pattyok
pattyok / dabblet.css
Created December 20, 2012 19:32
Untitled
; /**
* Christmas
*/
body{
background: #fff;
background: linear-gradient(180deg, #fff, #78C2C2);
min-height: 300px;
}
.snowball {
border-radius:50%;
/**
* ================== angular-ios9-uiwebview.patch.js v1.1.0 ==================
*
* This patch works around iOS9 UIWebView regression that causes infinite digest
* errors in Angular.
*
* The patch can be applied to Angular 1.2.0 – 1.4.5. Newer versions of Angular
* have the workaround baked in.
*
* To apply this patch load/bundle this file with your application and add a
@pattyok
pattyok / Image Rendering
Last active June 15, 2017 20:22
Use this when you have to use an image with text to keep it from being fuzzy.
image-rendering: -moz-crisp-edges; /* Firefox */
image-rendering: -o-crisp-edges; /* Opera */
image-rendering: -webkit-optimize-contrast;/* Webkit (non-standard naming) */
image-rendering: crisp-edges;
-ms-interpolation-mode: nearest-neighbor; /* IE (non-standard property) */
<?php
//Add these things to setup.php
//Add image sizes
add_image_size( 'facebook', 1230, 630, array('center', 'center') );
add_image_size( 'x-large', 1800, 1200, array('center', 'center') );
add_image_size( 'med-large', 600, 400, array('center', 'center') );
update_option( 'medium_size_w', 400 );
update_option( 'medium_size_h', 400 );
@pattyok
pattyok / acf-flexible-to-relevanssi.php
Created November 16, 2018 19:37
ACF Flexible Field Content in Relevanssi
<?php
//ADD Flexible content to Relevanssi
add_filter('relevanssi_excerpt_content', __NAMESPACE__ . '\\custom_fields_to_excerpts', 10, 3);
function custom_fields_to_excerpts($content, $post, $query) {
$sections = get_field('sections', $post->ID);
if ($sections) {
foreach ($sections as $section) {
if ($section['acf_fc_layout'] == 'content_editor') {
@pattyok
pattyok / taxonomy_filter.php
Last active July 19, 2019 14:30
WordPress: Create taxonomy filter for post admin screen
add_action( 'restrict_manage_posts', 'dated_pubs_table_filtering', 10, 2 );
function dated_pubs_table_filtering( $post_type, $which ) {
if ( 'dated_publications' === $post_type ) {
// A list of taxonomy slugs to filter by.
$taxonomies = array( 'dated_pub_type' );
foreach ( $taxonomies as $taxonomy_slug ) {
// Retrieve taxonomy data.
$taxonomy_obj = get_taxonomy( $taxonomy_slug );
@pattyok
pattyok / .eslintrc.json
Last active April 28, 2020 22:05
WordPress Coding Standards Setup
{
"extends": [
"plugin:@wordpress/eslint-plugin/recommended"
]
}
@pattyok
pattyok / runphp.sh
Created November 2, 2019 17:40
Run PHP server on Mac
php -S 127.0.0.1:8080
@pattyok
pattyok / us_states.md
Last active November 15, 2019 19:15
ACF State Selector

Click Raw and Copy into the Select field

AL : Alabama AK : Alaska AZ : Arizona AR : Arkansas CA : California CO : Colorado CT : Connecticut DE : Delaware

@pattyok
pattyok / functions.php
Created November 22, 2019 23:20
WordPress: When you want to pull in existing records from SalesForce via object-sync-to-salesforce
<?php
//Add this to your functions file TEMPORARILY (just long enough to do the first sync), then remove
add_filter( 'object_sync_for_salesforce_pull_query_modify', __NAMESPACE__ . '\\change_pull_query', 10, 4 );
// can always reduce this number if all the arguments are not necessary
function change_pull_query( $soql, $type, $salesforce_mapping, $mapped_fields ) {
$soql->conditions[0]['value'] = '2015-11-22T22:49:09Z';//change this date to early enough to capture your records
return $soql;