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 | |
add_action( 'after_setup_theme', 'rss_template' ); | |
/** | |
* Register custom RSS template. | |
*/ | |
function rss_template() { | |
add_feed( 'media', 'custom_rss' ); | |
} |
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
(function ($, root, undefined) { | |
$(function () { | |
'use strict'; | |
// DOM ready, take it away | |
function noSundaysOrSaturdays(date) { |
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 | |
add_filter('woocommerce_add_cart_item_data', 'namespace_force_individual_cart_items', 10, 2); | |
function namespace_force_individual_cart_items($cart_item_data, $product_id) { | |
$unique_cart_item_key = md5(microtime() . rand()); | |
$cart_item_data['unique_key'] = $unique_cart_item_key; | |
return $cart_item_data; | |
} |
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 | |
// Register casino | |
$labels = array( | |
'name' => __('Casino', 'tps'), | |
'singular_name' => __('Casino', 'tps'), | |
'add_new' => __('Add casino', 'tps'), | |
'add_new_item' => __('Add new casino', 'tps'), | |
'edit_item' => __('Edit casino', 'tps'), | |
'new_item' => __('New casino', 'tps'), |
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
<iframe width="100%" height="350" | |
src="http://localhost/ | |
index.php?module=Widgetize | |
&action=iframe | |
&widget=1 | |
&moduleToWidgetize=UserCountry | |
&actionToWidgetize=getCountry | |
&idSite=2 | |
&period=day | |
&date=yesterday |
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 | |
add_action('admin_footer', 'custom_bulk_admin_footer'); | |
/** | |
* Step 1: add the custom Bulk Action to the select menus | |
*/ | |
function custom_bulk_admin_footer() { | |
global $pagenow; |
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 | |
function disable_emojicons_tinymce( $plugins ) { | |
if ( is_array( $plugins ) ) { | |
return array_diff( $plugins, array( 'wpemoji' ) ); | |
} else { | |
return 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 | |
function backorder_text($available) { | |
foreach ($available as $key => $i) { | |
$available[$key] = str_replace('In stock', 'In stock and shipping!', $available[$key]); | |
$available[$key] = str_replace('Out of stock', 'Sold out', $available[$key]); | |
} |
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 | |
$query_images_args = array( | |
'post_type' => 'attachment', 'post_mime_type' =>'image', 'post_status' => 'inherit', 'posts_per_page' => -1, | |
); | |
$query_images = new WP_Query( $query_images_args ); | |
$images = array(); | |
foreach ( $query_images->posts as $image) { | |
$images[]= wp_get_attachment_url( $image->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 | |
function formatSizeUnits($bytes) { | |
if ($bytes >= 1073741824) { | |
$bytes = number_format($bytes / 1073741824, 2) . ' GB'; | |
} elseif ($bytes >= 1048576) { | |
$bytes = number_format($bytes / 1048576, 2) . ' MB'; | |
} elseif ($bytes >= 1024) { | |
$bytes = number_format($bytes / 1024, 2) . ' KB'; | |
} elseif ($bytes > 1) { |