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
| function create_field( $field ) | |
| { | |
| $o = array( 'id', 'class', 'min', 'max', 'step', 'name', 'value' ); | |
| $e = '<input type="number"'; | |
| foreach( $o as $k ) | |
| { | |
| $val = $field[ $k ]; | |
| if ( $k == 'step' && empty($val) ) $val = 'any'; | |
| $e .= ' ' . $k . '="' . esc_attr( $val ) . '"'; |
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
| 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 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
| 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 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
| 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 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
| 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 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
| 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 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
| // 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 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
| 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 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
| // 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 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
| 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': |