This code how to replace the traditional radio-buttons, for custom images. You can do the same with checkboxes.
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 rh_get_widget_data_for($sidebar_name) { | |
global $wp_registered_sidebars, $wp_registered_widgets; | |
// Holds the final data to return | |
$output = array(); | |
// Loop over all of the registered sidebars looking for the one with the same name as $sidebar_name | |
$sibebar_id = false; | |
foreach( $wp_registered_sidebars as $sidebar ) { | |
if( $sidebar['name'] == $sidebar_name ) { |
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
/* Get featured image */ | |
if( !function_exists( 'get_the_post_thumbnail_by_blog' ) ) { | |
function get_the_post_thumbnail_by_blog($blog_id=NULL,$post_id=NULL,$size='post-thumbnail',$attrs=NULL) { | |
global $current_blog; | |
$sameblog = false; | |
if( empty( $blog_id ) || $blog_id == $current_blog->ID ) { | |
$blog_id = $current_blog->ID; | |
$sameblog = true; | |
} |
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
/* Get Latest post from all blogs */ | |
function recent_mu_posts( $howMany = 10 ) { | |
global $wpdb; | |
global $table_prefix; | |
// get an array of the table names that our posts will be in | |
// we do this by first getting all of our blog ids and then forming the name of the | |
// table and putting it into an array | |
$rows = $wpdb->get_results( "SELECT blog_id from $wpdb->blogs WHERE | |
public = '1' AND archived = '0' AND mature = '0' AND spam = '0' AND deleted = '0';" ); |
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: Email Confirmation | |
* Description: Send an email to the user with confirmation code and store form data in database until user confirms. | |
* Author: Cedric Ruiz | |
*/ | |
class EmailConfirmation | |
{ | |
const PREFIX = 'email-confirmation-'; |
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 | |
/** | |
* WooCommerce Ajax Handlers | |
* | |
* Handles AJAX requests via wp_ajax hook (both admin and front-end events) | |
*/ | |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly | |
/** Frontend AJAX events **************************************************/ |
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
/************************* | |
* Enqueue Media Uploader | |
*************************/ | |
function enqueue_admin_scripts() { | |
if(function_exists('wp_enqueue_media')) { | |
wp_enqueue_media(); | |
} | |
else { | |
wp_enqueue_script('media-upload'); | |
wp_enqueue_script('thickbox'); |
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
<form> | |
<div id="container"> | |
<input type="text" value="" /><br /> | |
<textarea></textarea><br /> | |
<select> | |
<option value="1" selected="selected">1</option> | |
<option value="2">2</option> | |
<option value="3">3</option> | |
</select><br/> | |
<select> |
#####Enter following command to disable auto open nautilus window after mount Terminal Command:
gsettings set org.gnome.desktop.media-handling automount-open false
#####Enter following command in terminal to disable overlay scrollbar Terminal Command:
gsettings set com.canonical.desktop.interface scrollbar-mode normal
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
wget https://copy.com/install/linux/Copy.tgz | |
tar -xvzf Copy.tgz | |
# optional clean-up | |
rm Copy.tgz | |
# If your Ubuntu is Ubuntu 64bits: | |
cd copy/x86_64 | |
# If your Ubuntu is Ubuntu 32bits: |