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 | |
// Initialize the Class and add the action | |
add_action('init', 'pTypesInit'); | |
function pTypesInit() { | |
global $products; | |
$products = new TypeProducts(); | |
} | |
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ | |
/* * * * * * * * * Best Products Post Type Class * * * * * * * * * * * * * */ |
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 MyScript(){} | |
(function() { | |
var THIS = this; | |
function defined(x) { | |
return typeof x != 'undefined'; | |
} | |
this.ready = false; | |
this.init = function() { | |
this.ready = 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
n2wp = {} | |
n2wp.timezone = function() { | |
var timezone = (new Date().getTimezoneOffset() / 60) * (-1); | |
return timezone; | |
} | |
n2wp.loading = function() { | |
return ' | |
<div class="loading"><span>Loading...</span></div> | |
'; |
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
add_action('restrict_manage_posts','restrict_manage_movie_sort_by_genre'); | |
function restrict_manage_movie_sort_by_genre() { | |
if (isset($_GET['post_type'])) { | |
$post_type = $_GET['post_type']; | |
if (post_type_exists($post_type) && $post_type=='movie') { | |
global $wpdb; | |
$sql=<<<SQL | |
SELECT pm.meta_key FROM {$wpdb->postmeta} pm | |
INNER JOIN {$wpdb->posts} p ON p.ID=pm.post_id | |
WHERE p.post_type='movie' AND pm.meta_key='Genre' |
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 additional_info() { | |
global $post; | |
$custom = get_post_custom($post->ID); | |
$additional_info = $custom["additional_info"][0]; | |
// this adds an extra tinymce field | |
?> | |
<script type="text/javascript"> | |
jQuery(document).ready(function() { | |
jQuery("#additional_info_textarea").addClass("mceEditor"); |
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
<doCTyPe html> | |
<head> | |
<title>VG Events: Ask the Staffs</title> | |
</head> | |
<body> | |
<?php | |
/* Turtles */ |
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 | |
/** | |
* @constructor overloading using the __call() function | |
* | |
*/ | |
class Player { | |
private $name; | |
private $surname; | |
private $country; |
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() { | |
// Establish the root object, `window` in the browser, or `global` on the server. | |
var root = window.document; | |
var JL = function( selector, context ) { | |
// The JL object is actually just the init constructor 'enhanced' | |
return new JL.fn.init( selector, context ); | |
}, | |
// A simple way to check for HTML strings or ID strings |
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 | |
/** | |
* Custom Metabox for uploading post image attachments | |
* Created by Jared Williams - http://new2wp.com | |
*/ | |
add_action( 'admin_init', 'add_attachment' ); | |
add_action( 'save_post', 'update_attachment' ); | |
add_action( 'post_edit_form_tag', 'form_multipart_encoding' ); | |
//add_action( 'manage_posts_custom_column', 'product_custom_columns' ); | |
//add_filter( 'manage_edit-product_columns', 'product_edit_columns' ); |
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 | |
function update_attachment() { | |
global $post; | |
wp_update_attachment_metadata( $post->ID, $_POST['a_image'] ); | |
if( !empty( $_FILES['a_image']['name'] )) { | |
require_once( ABSPATH . 'wp-admin/includes/file.php' ); | |
$override['action'] = 'editpost'; | |
$file = wp_handle_upload( $_FILES['a_image'], $override ); |
OlderNewer