This file contains 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 | |
// Example meta box field | |
$cmb->add_field( array( | |
'name' => 'Test Select', | |
'id' => 'test_select', | |
'type' => 'pw_multiselect', | |
'options_cb' => 'iweb_get_cmb2_term_options', | |
'get_terms_args' => array( | |
'taxonomy' => 'post_tag', | |
), |
This file contains 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 | |
/** | |
* Push custom fields to Algolia. | |
* | |
* @param array $attributes | |
* @param WP_Post $post | |
* | |
* @return array | |
*/ | |
function iweb_algolia_product_attributes( array $attributes, WP_Post $post ) { |
This file contains 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 | |
wp_register_script( 'pw-google-maps-api', 'https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false', null, null, true ); | |
wp_enqueue_script( 'pw-store-locations', get_stylesheet_directory_uri() . '/js/store-locations.js', array( 'jquery', 'pw-google-maps-api' ), null, true ); |
This file contains 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 | |
/** | |
* Add classes to subcategory images. | |
* | |
* @param $category | |
*/ | |
function kanuka_category_custom_thumbnail( $category ) { | |
$output = ''; | |
ob_start(); | |
woocommerce_subcategory_thumbnail( $category ); |
This file contains 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 | |
/** | |
* Add a class to tags. | |
* | |
* @param string $html The HTML content. | |
* @param array $tags List of HTML tags to add a class to. | |
* @param string $class The class to add. | |
* @param bool $exception Optional. If the exception value has been defined, it'll take precedence. | |
* | |
* @return array|string|string[]|null |
This file contains 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 | |
/** | |
* Filter a few parameters into YouTube oEmbed requests | |
* | |
* @link http://goo.gl/yl5D3 | |
*/ | |
function iweb_modest_youtube_player( $html, $url, $args ) { | |
return str_replace( '?feature=oembed', '?feature=oembed&modestbranding=1&showinfo=0&rel=0', $html ); | |
} | |
add_filter( 'oembed_result', 'iweb_modest_youtube_player', 10, 3 ); |
This file contains 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 | |
/** | |
* Filter Jetpack widget visibility page list - include all pages, not just those which are published. | |
* | |
* @param stdClass[] $pages Array of objects containing only the ID, post_parent, and post_title fields. | |
* @param array $parsed_args Array of get_pages() arguments. | |
*/ | |
function iweb_jetpack_widget_visibility_get_pages( $pages, $parsed_args ) { | |
global $wpdb; |
This file contains 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 | |
/** | |
* Yoast SEO breadcrumbs - link directly to child page when the parent has our | |
* "first child redirect" template. | |
* | |
* @param array $crumbs The complete list of breadcrumbs. | |
* | |
* @return array | |
*/ | |
function kanuka_wpseo_breadcrumbs_first_child_redirect( $crumbs ) { |
This file contains 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: List Image URLs From Attachment IDs | |
Plugin URI: https://www.philwylie.co.uk/ | |
Description: Generate list of original attachment file URLs from a list of attachment IDs. Download using something like Tab Save - https://link.from.pw/3veCu6q | |
Version: 1.0.0 | |
Author: Phil Wylie | |
Author URI: https://www.philwylie.co.uk/ | |
License: GPL2 | |
*/ |