This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <? | |
| /** | |
| * Repeatable Custom Fields in a Metabox | |
| * Author: Helen Hou-Sandi | |
| * | |
| * From a bespoke system, so currently not modular - will fix soon | |
| * Note that this particular metadata is saved as one multidimensional array (serialized) | |
| */ | |
| function hhs_get_sample_options() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * The main template file. | |
| * | |
| * @package WordPress | |
| */ | |
| function run_once($key){ | |
| $test_case = get_option('run_once'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| class Registry { | |
| /** | |
| * @var array The store for all objects | |
| */ | |
| static private $store = array(); | |
| /** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /* This snippet removes the action that inserts thumbnails to products in teh loop | |
| * and re-adds the function customized with our wrapper in it. | |
| * It applies to all archives with products. | |
| * | |
| * @original plugin: WooCommerce | |
| * @author of snippet: Brian Krogsard | |
| */ | |
| remove_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail', 10); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ———————————————————————————————————————————————————————————————————————————————————————————————————— | |
| BBEdit / BBEdit-Lite / TextWrangler Regular Expression Guide Modified: 2018/08/10 01:19 | |
| ———————————————————————————————————————————————————————————————————————————————————————————————————— | |
| NOTES: | |
| The PCRE engine (Perl Compatible Regular Expressions) is what BBEdit and TextWrangler use. | |
| Items I'm unsure of are marked '# PCRE?'. The list while fairly comprehensive is not complete. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Plugin Name: MU plugins subdirectory loader | |
| * Plugin URI: https://gist.github.com/lavoiesl/6302907 | |
| * Description: Enables the loading of plugins sitting in mu-plugins (as folders) | |
| * Version: 0.1 | |
| * Author: [email protected] | |
| * Author URI: http://blog.lavoie.sl/ | |
| * |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Change the description tab title to product name | |
| add_filter( 'woocommerce_product_tabs', 'wc_change_product_description_tab_title', 10, 1 ); | |
| function wc_change_product_description_tab_title( $tabs ) { | |
| global $post; | |
| if ( isset( $tabs['description']['title'] ) ) | |
| $tabs['description']['title'] = $post->post_title; | |
| return $tabs; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $file = '/path/to/file.png'; | |
| $filename = basename($file); | |
| $upload_file = wp_upload_bits($filename, null, file_get_contents($file)); | |
| if (!$upload_file['error']) { | |
| $wp_filetype = wp_check_filetype($filename, null ); | |
| $attachment = array( | |
| 'post_mime_type' => $wp_filetype['type'], | |
| 'post_parent' => $parent_post_id, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /* | |
| * Plugin Name: Paulund WP List Table Example | |
| * Description: An example of how to use the WP_List_Table class to display data in your WordPress Admin area | |
| * Plugin URI: http://www.paulund.co.uk | |
| * Author: Paul Underwood | |
| * Author URI: http://www.paulund.co.uk | |
| * Version: 1.0 | |
| * License: GPL2 | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // original source: http://kuwamoto.org/2007/12/17/improved-pluralizing-in-php-actionscript-and-ror/ | |
| /* | |
| The MIT License (MIT) | |
| Copyright (c) 2015 | |
| Permission is hereby granted, free of charge, to any person obtaining a copy |
OlderNewer