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
function gga_set_featured_image_from_url($post_id, $url) { | |
$temp_file = download_url( $url ); | |
if (is_wp_error( $temp_file )) | |
return $temp_file; | |
$file_array['name'] = basename( $url ); | |
$file_array['tmp_name'] = $temp_file; | |
$sideloaded_id = media_handle_sideload( $file_array, $post_id ); |
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
var CMB_Linklist = { | |
init : function ( field ) { | |
var _this = this; | |
_this.uniqueID = jQuery(field).find( '.linklist-wrap' ).attr( 'id' ); | |
field.find('button.cmb-linklist-toggle').click( function(e) { | |
e.preventDefault(); |
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 | |
define( 'PLUGIN_BASENAME', plugin_basename( __FILE__ ) ); | |
function my_plugin_row_meta( $plugin_meta, $plugin_file, $plugin_data, $status ) { | |
if ( PLUGIN_BASENAME == $plugin_file ) | |
$plugin_meta[] = '<a href="#">Test: plugin_row_meta</a>'; | |
return $plugin_meta; | |
} | |
add_filter( 'plugin_row_meta', 'my_plugin_row_meta', 10, 4 ); |
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 | |
/** | |
* Filters get_post_meta() to ensure old commission status checks don't fail | |
* | |
* The status for commission records used to be stored in postmeta, now it's stored in a taxonomy | |
* | |
* @access private | |
* @since 2.8 | |
* @return mixed |
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 | |
// Do NOT add the line above when you copy. | |
/** Add previous/next post navigation on book posts. | |
* http://snipplr.com/view/74493/adjacent-post-by-alphabetical-order-in-wordpress/ | |
* /wp-includes/link-template.php | |
* line 1608 | |
* $where = apply_filters( "get_{$adjacent}_post_where", $wpdb->prepare( "WHERE p.post_date $op %s AND p.post_type = %s $where", $current_post_date, $post->post_type ), $in_same_term, $excluded_terms ); | |
* line 1620 | |
* $sort = apply_filters( "get_{$adjacent}_post_sort", "ORDER BY p.post_date $order LIMIT 1" ); |
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 | |
$sites = wp_get_sites(); | |
foreach($sites as $site) : | |
// Only subsites | |
if (!is_main_site($site['blog_id'])) : | |
// Connect to new multisite |
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
# Note that while this file is in our config folder, it is | |
# symlinked to our site folders, so paths are relative from there | |
# Require gems and Compass plugins | |
# require 'rgbapng' | |
# require 'compass-fancybox-plugin' | |
require 'compass-growl' | |
# General | |
output_style = :expanded |
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
<div id="styleguide-icon-grid"></div> | |
<object data="/assets/icons.svg" id="svgembed" height=0; width=0></object> | |
<script> | |
var grid = document.querySelector('#styleguide-icon-grid'); | |
var tmpl = '<div class="item"><svg class="icon"><use xlink:href="/assets/icons.svg#{id}"></use></svg><span>#{id}</span></div>'; | |
function svgloaded() { | |
var svgEmbed = document.querySelector("#svgembed"); | |
var svg = svgEmbed.getSVGDocument(); |
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_action( 'wp_enqueue_scripts', 'enqueue_my_styles' ); | |
/** | |
* Example callback function that demonstrates how to properly enqueue conditional stylesheets in WordPress for IE. | |
* IE10 and up does not support conditional comments in standards mode. | |
* | |
* @uses wp_style_add_data() WordPress function to add the conditional data. | |
* @link https://developer.wordpress.org/reference/functions/wp_style_add_data/ |
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 | |
/** | |
* WordPress Chosen Taxonomy Metabox | |
* Author: Helen Hou-Sandi | |
* | |
* Use Chosen for a replacement taxonomy metabox in WordPress | |
* Useful for taxonomies that aren't changed much on the fly and are | |
* non-hierarchical in nature, as Chosen is for flat selection only. | |
* You can always use the taxonomy admin screen to add/edit taxonomy terms. | |
* Categories need slightly different treatment from the rest in order to |
OlderNewer