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('wp_head', 'form_acf', 10 ); | |
public function form_acf() { | |
if ( is_page('Add an Opportunity') ) { | |
echo '<script src="https://maps.googleapis.com/maps/api/js?sensor=false" type="text/javascript"></script>'; | |
acf_form_head(); | |
} | |
} |
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 wordpress_fix_bug( $wp_query ) { | |
// The function below is a temporary fix for this bug: http://core.trac.wordpress.org/ticket/18614 | |
if ( $wp_query->is_post_type_archive && $wp_query->is_tax ) { | |
global $post_type_obj; | |
$wp_query->is_tax = false; | |
$post_type_obj = get_queried_object(); | |
if (empty($post_type_obj->labels)) { | |
$post_type_obj->labels = new stdClass(); | |
$post_type_obj->labels->name = 'dev/hack to fix WordPress Bug'; | |
} |
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
if ( $crop ) { | |
$cmp_x = $orig_width / $dest_width; | |
$cmp_y = $orig_height / $dest_height; | |
// Calculate x or y coordinate, and width or height of source | |
if ( $cmp_x > $cmp_y ) { | |
$src_w = round( $orig_width / $cmp_x * $cmp_y ); | |
$src_x = round( ( $orig_width - ( $orig_width / $cmp_x * $cmp_y ) ) / 2 ); | |
} | |
else if ( $cmp_y > $cmp_x ) { | |
$src_h = round( $orig_height / $cmp_y * $cmp_x ); |
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 function_name($user_id) { | |
if( isset($_POST['company_name']) ) update_user_meta( $user_id, 'company_name', $_POST['company_name'] ); | |
} | |
add_action( 'user_register', 'function_name'); |
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
public function profile_save( $user_id ) { | |
$fields = self::$setup['theme']['profile']['fields']; | |
if ( !current_user_can( 'edit_user', $user_id ) ) return false; | |
foreach ($fields as $field => $attr) { | |
if ( isset($_POST[$field]) || isset($_FILES[$field]) ) { | |
$value = $_POST[$field]; | |
if ( $value ) update_user_meta( $user_id, $field, $value ); | |
} | |
} | |
} |
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
// Functions Go Here | |
$(function(){ // on ready code goes here | |
var form = $('.direct-upload'); | |
form.fileupload({ | |
url: form.attr('action'), | |
type: 'POST', | |
// autoUpload: true, | |
dataType: 'xml', // This is really important as s3 gives us back the url of the file in a XML document | |
process: [ |
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
public function range_add($aVars) { | |
$aVars[] = "range"; | |
return $aVars; | |
} | |
public function range_where( $where, $args ) { | |
if( !is_admin() ) { | |
$range = ( isset($args->query_vars['range']) ? $args->query_vars['range'] : false ); | |
if( $range ) { | |
$range = split(',',$range); | |
$where .= "AND LEFT(wp_posts.post_title,1) BETWEEN '$range[0]' AND '$range[1]'"; |
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
// Added "before_delete_post" action to trigger rel_cleanup (cleans up all associated posts with rel_ meta_keys when a post is deleted) | |
function Acf() | |
{ | |
// vars | |
$this->path = plugin_dir_path(__FILE__); | |
$this->dir = plugins_url('',__FILE__); | |
$this->version = '3.3.9'; | |
$this->upgrade_version = '3.3.3'; // this is the latest version which requires an upgrade | |
$this->cache = array(); // basic array cache to hold data throughout the page load |
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 parse_message( &$tweet ) { | |
if ( !empty($tweet['entities']) ) { | |
$replace_index = array(); | |
$append = array(); | |
$text = $tweet['text']; | |
foreach ($tweet['entities'] as $area => $items) { | |
$prefix = false; | |
$display = false; | |
switch ( $area ) { | |
case 'hashtags': |
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
2012-05-29 13:22:55.009 osascript[72787:903] Error loading /Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types: dlopen(/Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types, 262): no suitable image found. Did find: | |
/Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types: no matching architecture in universal wrapper | |
osascript: OpenScripting.framework - scripting addition "/Library/ScriptingAdditions/Adobe Unit Types.osax" declares no loadable handlers. | |
--- /Users/bushaw/Downloads/gravity-forms-update-post/gravityforms-update-post.php | |
+++ gravityforms-update-post.php | |
@@ -126,6 +126,22 @@ | |
} | |
public function gform_pre_render($form) { | |
+ ?> |