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 fb_1398591523488596( $classes, $class, $post_id ) { | |
if ( 'product' == get_post_type( $post_id ) ) { | |
$classes[] = "my-amazing-product-class"; | |
} | |
return $classes; | |
} |
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 | |
class WDS_FTPext_How_To { | |
/** | |
* Instance of WDS_FTPext_How_To | |
* @var WDS_FTPext_How_To | |
*/ | |
public static $instance = 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 | |
funciton get_an_id() { | |
$posts_arr = get_posts( array( 'fields' => 'ids', 'posts_per_page' => 1, 'no_found_rows' => true ) ); | |
$post_id = false; | |
if ( ! empty( $posts_arr ) ) { | |
$post_id = $posts_arr[0]; | |
} | |
return $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
Time: 12/05/16 23:31 | |
Description: Loading NBT data | |
java.io.UTFDataFormatException: malformed input around byte 5 | |
at java.io.DataInputStream.readUTF(DataInputStream.java:656) | |
at java.io.DataInputStream.readUTF(DataInputStream.java:564) | |
at net.minecraft.nbt.NBTTagCompound.func_152448_b(NBTTagCompound.java:383) | |
at net.minecraft.nbt.NBTTagCompound.func_152446_a(NBTTagCompound.java:50) | |
at net.minecraft.nbt.NBTTagList.func_152446_a(NBTTagList.java:54) | |
at net.minecraft.nbt.NBTTagCompound.func_152449_a(NBTTagCompound.java:393) |
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_post_replys() { | |
$reply_ids = get_posts( array( | |
'post_type' => 'reply', | |
'posts_per_page' => -1 // Pulls ALL posts. | |
'post_status' => 'any' // Defaults to publish, so set any to get all | |
'fields' => 'ids' // Save on php memory, only grab post ID's | |
) ); |
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 | |
if ( defined( 'WP_CLI' ) && WP_CLI ) { | |
class JW_Random_Posts extends WP_CLI_Command { | |
private $args, $assoc_args; | |
/** | |
* Generates a Random set of posts | |
* |
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
/** | |
* SerializeOnDemand | |
* | |
* In theory you could do this inline, but sometimes its easier to just | |
* do it within a method and re-use it where you need to. | |
* | |
* @return {object} Serialized Object | |
*/ | |
var searializeOnDemand = function() { | |
// Go ahead and serialize the form 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
jQuery.post( ajaxurl, jQuery( '#theForm' ).seraizlize(), function( response ) { | |
/** | |
* At this point, response should equal a json encoded response | |
* SO if you're doing something like this: | |
* | |
* wp_send_json_success( array( 'some_key' => 'some value' ) ) | |
* you can access it like so: | |
*/ | |
if ( response.success ) { |
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
// Basic linear javascript for example_class ajax | |
/** | |
* Ajax Success Handler | |
* @param {obj} data Response Object | |
* @return {null} | |
*/ | |
var ajaxSuccess = function( data ) { | |
if ( window.console ) { | |
window.console.log( data ); |