View gga-set-featured-image-from-url.php
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 gga_set_featured_image_from_url($post_id, $url) { | |
$temp_file = download_url( $url ); | |
if (is_wp_error( $temp_file )) | |
return $temp_file; | |
$file_array['name'] = basename( $url ); | |
$file_array['tmp_name'] = $temp_file; | |
$sideloaded_id = media_handle_sideload( $file_array, $post_id ); |
View gist:2870362
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 Walker_Nav_Menu_Mobile extends Walker_Nav_Menu{ | |
var $to_depth = -1; | |
function start_lvl(&$output, $depth){ | |
$output .= '</option>'; | |
} | |
function end_lvl(&$output, $depth){ |
View gist:2981540
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
// http://www.gravityhelp.com/forums/topic/mathematics-to-gravity-forms | |
add_action('gform_pre_submission', 'ch_total_quiz_values'); | |
function ch_total_quiz_values ($form) { | |
// change the number 20 here to your form ID | |
// if this is not form 20, don't do any processing | |
if($form['id'] != 3) | |
return $form; | |
// otherwise ... | |
$score = 0; |
View big-bgs.php
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 | |
/** | |
* Full-size Backgrounds using a Post Type of Background | |
* | |
* Function that selects a custom post type 'background'. | |
* Uses the Post Thumbnail as the background image. | |
* On the Page template(s) where it's needed, call s25_full_bg. | |
* | |
*/ | |
function s25_full_bg() { |
View wp-config.php
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 | |
/** | |
* The base configurations of the WordPress. | |
* | |
* This file has the following configurations: MySQL settings, Table Prefix, | |
* Secret Keys, WordPress Language, and ABSPATH. You can find more information | |
* by visiting {@link http://codex.wordpress.org/Editing_wp-config.php Editing | |
* wp-config.php} Codex page. You can get the MySQL settings from your web host. | |
* | |
* This file is used by the wp-config.php creation script during the |
View wp-config.php
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 | |
/** | |
* The base configurations of the WordPress. | |
* | |
* This file has the following configurations: MySQL settings, Table Prefix, | |
* Secret Keys, WordPress Language, and ABSPATH. You can find more information | |
* by visiting {@link http://codex.wordpress.org/Editing_wp-config.php Editing | |
* wp-config.php} Codex page. You can get the MySQL settings from your web host. | |
* | |
* This file is used by the wp-config.php creation script during the |
View functions.php
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 | |
// Grab Authorized Users | |
$admins = new WP_User_Query( array( 'role' => 'bbp_keymaster', 'fields' => 'ID' ) ); | |
$moderators = new WP_User_Query( array( 'role' => 'bbp_moderator', 'fields' => 'ID' ) ); | |
$users = array_merge( $admins->results, $moderators->results ); | |
// Build the bbPress query | |
// ... |
View gist:146c6f90bc8194c7dba1
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 | |
/** | |
* Filters get_post_meta() to ensure old commission status checks don't fail | |
* | |
* The status for commission records used to be stored in postmeta, now it's stored in a taxonomy | |
* | |
* @access private | |
* @since 2.8 | |
* @return mixed |
View functions.php
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 | |
add_action('gform_after_submission', 'post_to_third_party', 10, 2); | |
function post_to_third_party($entry, $form) { | |
$post_url = 'http://forms.franklin.edu/newsletter-registration/Register'; | |
$body = array( | |
'fullName' => $entry['1.1'], | |
'email' => $entry['1.2'] | |
); | |
$request = new WP_Http(); | |
$response = $request->post($post_url, array('body' => $body)); |
View plugin.php
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 | |
/** | |
* Don't Update Plugin | |
* | |
* This prevents you being prompted to update if there's a public plugin | |
* with the same name. | |
* | |
* @since 1.0.0 | |
* @author Mark Jaquith |
OlderNewer