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 | |
/** | |
* Filter the link query arguments. | |
* | |
* Allows modification of the link query arguments before querying. | |
* | |
* @since 3.7.0 | |
* | |
* @param array $query { | |
* An array of query arguments. |
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 | |
/** | |
* @type string 'sort_column' What columns to sort pages by, comma-separated. | |
* Default 'post_title'. Accepts 'post_author', 'post_date', 'post_title', 'post_name', 'post_modified', 'post_modified_gmt', 'post_parent', 'menu_order', 'ID', 'rand', 'comment_count'). | |
* |
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 | |
/** | |
* Update one or more post fields | |
* | |
* @global wpdb $wpdb | |
* | |
* @param array $field Array of field/value pairs to update. | |
* @param WP_Post|int $post Post object or id. | |
* | |
* @return int|bool Number of updated rows, false on failure. |
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 | |
class Unnamed_Theme { | |
public function __construct() { | |
add_filter( 'wp_update_attachment_metadata', array( $this, 'update_image_date' ), 10, 2 ); | |
} | |
/** | |
* Update the 'post_date' field with the date in the image meta | |
* | |
* @param array $data The attachment meta 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 | |
class Unnamed_Theme { | |
public function __construct() { | |
add_filter( 'login_redirect', array( $this, 'login_redirect' ), 10, 3 ); | |
} | |
public function login_redirect( $redirect_to, $request, $user ) { | |
return admin_url( 'media-new.php' ); | |
} |
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 | |
/** | |
* WP Docs Collection Class | |
* | |
* Stores data sets commonly referenced in WordPress inline documentation. | |
* | |
* @since 3.7.0 | |
*/ | |
class WP_Docs { |
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 | |
/** | |
* @param array $date_query { | |
* @type string 'column' (optional) Column to query against, default is 'post_date'. | |
* @type string 'compare' (optional) Comparison operator, defaul is '='. @see WP_Date_Query::get_compare() | |
* @type string 'relation' (optional) How the sub-arrays should be compared, accepts 'AND' (default) or 'OR'. | |
* } |
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
http://codex.wordpress.org/Function_Reference/get_attached_audio | |
http://codex.wordpress.org/Function_Reference/get_attached_video | |
http://codex.wordpress.org/Function_Reference/get_attached_images | |
http://codex.wordpress.org/Function_Reference/get_attached_image_srcs | |
http://codex.wordpress.org/Function_Reference/get_content_media | |
http://codex.wordpress.org/Function_Reference/get_content_audio | |
http://codex.wordpress.org/Function_Reference/get_content_video | |
http://codex.wordpress.org/Function_Reference/get_content_images | |
http://codex.wordpress.org/Function_Reference/get_content_image | |
http://codex.wordpress.org/Function_Reference/get_content_galleries |
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
#!/bin/bash | |
# usage: ORIG=###### NEW=###### ./gistmerge.sh | |
# $ORIG = The Gist ID of your Gist | |
# $NEW = The Gist ID of the fork | |
# Note: chmod u+x gistmerge.sh may be necessary | |
# if you're getting permissions errors | |
printf "\n\n... Cloning original Gist.\n\n" |
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
<? | |
/** | |
* Repeatable Custom Fields in a Metabox | |
* Author: Helen Hou-Sandi | |
* | |
* From a bespoke system, so currently not modular - will fix soon | |
* Note that this particular metadata is saved as one multidimensional array (serialized) | |
*/ | |
function hhs_get_sample_options() { |