Based on the AA Git Commit Log from Ahmad Awais 💯
sidenote: example text here
📦 NEW:
- field name
- function
example - another item
Based on the AA Git Commit Log from Ahmad Awais 💯
sidenote: example text here
📦 NEW:
example| <?php | |
| // Get attachment ID from the file URL. | |
| function sandbox_get_image_id( $image_url ) { | |
| global $wpdb; | |
| $attachment = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE guid='%s';", $image_url ) ); | |
| return $attachment[0]; | |
| } | |
| /** | |
| * FUNCTION: sandbox_wc_image |
Add the PPA
sudo add-apt-repository ppa:ondrej/php
Update repos
sudo apt-get update
| #!/bin/sh | |
| # Written by: Keefer Rourke <https://krourke.org> | |
| # Based on AUR package <https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=ttf-google-fonts-git> | |
| # dependancies: fonts-cantarell, ttf-ubuntu-font-family, git | |
| sudo apt-get install fonts-cantarell, ttf-ubuntu-font-family, git | |
| srcdir="/tmp/google-fonts" | |
| pkgdir="/usr/share/fonts/truetype/google-fonts" | |
| giturl="git://github.com/google/fonts.git" |
| <?php | |
| $current_user = wp_get_current_user(); | |
| $billing_postcode = get_user_meta( $current_user->ID, 'billing_postcode', true ); |
| <?php | |
| // Get loop of all Pages. | |
| $args = array( | |
| 'sort_column' => 'post_title', | |
| 'hierarchical' => 1, | |
| 'post_type' => 'page', | |
| 'post_status' => 'publish' | |
| ); | |
| $pages = get_pages( $args ); |
| <?php | |
| /** | |
| * @snippet Do Something When Product is Published | |
| * @how-to Watch tutorial @ https://businessbloomer.com/?p=19055 | |
| * @sourcecode https://businessbloomer.com/?p=543 | |
| * @author Rodolfo Melogli | |
| * @testedwith WooCommerce 3.2.6 | |
| */ | |
| function add_this_to_new_products( $new_status, $old_status, $post ) { |
| <?php | |
| /* | |
| Plugin Name: PMPro Limit Available Plugins and Themes | |
| Plugin URI: http://www.paidmembershipspro.com/wp/pmpro-limit-available-plugins/ | |
| Description: Limits Which Plugins are Available for Network Sites | |
| Version: .1 | |
| Author: Stranger Studios | |
| Author URI: http://www.strangerstudios.com | |
| 1. Place this file in wp-content/mu-plugins. |
| <?php | |
| /** | |
| * Add Category taxonomy for the Flowers Custom Post Type | |
| */ | |
| function flowers_category( $data, $post, $request ) { | |
| $_data = $data->data; | |
| $_data['flowers_category'] = get_the_term_list( $post->ID, 'flowers_category', '', ' ', '' ); | |
| $data->data = $_data; | |
| return $data; | |
| } |