##Theme Structure
| Template | Description |
|---|---|
| header.php | Header Section |
| index.php | Main Section |
| sidebar.php | Sidebar Section |
| single.php | Post Template |
| page.php | Page Template |
| comments.php | Comment Template |
| -- List all orphan rows from wp_postmeta | |
| SELECT * FROM wp_postmeta | |
| LEFT JOIN wp_posts ON wp_posts.ID = wp_postmeta.post_id | |
| WHERE wp_posts.ID IS NULL; | |
| -- Delete orphan postmeta | |
| DELETE pm | |
| FROM wp_postmeta pm | |
| LEFT JOIN wp_posts p ON pm.post_id = p.ID | |
| WHERE p.ID IS NULL; |
| <?php | |
| $array_base = get_option('wpseo-premium-redirects-base'); | |
| foreach ( $array_base as $key => $row ) { | |
| file_put_contents( ABSPATH . 'yoast-redirects-base.csv', $key . ',' . $row[ 'url' ] . "\n", FILE_APPEND ); | |
| } | |
| $array_plain = get_option('wpseo-premium-redirects-export-plain'); | |
| foreach ( $array_plain as $key => $row ) { | |
| file_put_contents( ABSPATH . 'yoast-redirects-export-plain.csv', $key . ',' . $row[ 'url' ] . "\n", FILE_APPEND ); |
| <?php | |
| namespace HWID\SampleCode; | |
| class GravityForms { | |
| public static function init() { | |
| add_filter( 'gform_custom_merge_tags', [ 'HWID\SampleCode\GravityForms', 'custom_merge_tags' ], 10, 4 ); | |
| add_filter( 'gform_replace_merge_tags', [ 'HWID\SampleCode\GravityForms', 'replace_merge_tags' ], 10, 3 ); | |
| } | |
| /** |
| #!/bin/sh | |
| brew tap homebrew/cask-drivers | |
| brew install --cask homebrew/cask-versions/adoptopenjdk8 | |
| brew install --cask ubiquiti-unifi-controller |
##Theme Structure
| Template | Description |
|---|---|
| header.php | Header Section |
| index.php | Main Section |
| sidebar.php | Sidebar Section |
| single.php | Post Template |
| page.php | Page Template |
| comments.php | Comment Template |
| /** | |
| * Gravity Wiz // Gravity Forms // Change Field ID via Browser Console | |
| * | |
| * Provides a simple function for changing the ID of a Gravity Forms field via the browser console from the Form Editor page. | |
| * | |
| * @version 1.0 | |
| * @author David Smith <david@gravitywiz.com> | |
| * @license GPL-2.0+ | |
| * @link http://gravitywiz.com/changing-your-gravity-forms-field-ids/ | |
| * @video http://www.screencast.com/t/STm1eLZEsR9q |
| #!/bin/bash | |
| find /uploads/sites/*/20* -type f -iname "*.png" -exec pngquant --speed 1 --skip-if-larger --strip {} \; | |
| find /uploads/sites/*/20* -type f -iname "*.png" -exec advpng -z4 {} \; | |
| find /uploads/sites/*/20* -type f -iregex .*\.jpe?g$ -exec jpegoptim -f -s -v -m 50 {} \; | |
| touch optimg.flag | |
| # find's -newer command option compares the timestamps of files found against a defined file, in our case optimg.flag | |
| # when we finish optimizing all of the images we touch the optimg.flag file to update its timestamp |
A Pen by Mike Kormendy on CodePen.
| <?php | |
| // Manually create entries and send notifications with Gravity Forms | |
| $form_id = 10; | |
| // add entry | |
| $entry = array( | |
| "form_id" => $form_id, | |
| "1" => "Entry for field ID 1", |
| <?php | |
| /* | |
| Plugin Name: WordPress MU Domain Mapping | |
| Plugin URI: http://ocaoimh.ie/wordpress-mu-domain-mapping/ | |
| Description: Map any blog on a WordPress website to another domain. | |
| Version: 0.5.5 | |
| Author: Donncha O Caoimh | |
| Author URI: http://ocaoimh.ie/ | |
| */ | |
| /* Copyright Donncha O Caoimh (http://ocaoimh.ie/) |