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( 'gform_after_submission', '_convert_date_to_timestamp', 10, 2 ); // Extend | |
| function _convert_date_to_timestamp( $entry, $form ) { | |
| date_default_timezone_set ( "America/Denver" ); | |
| // Make sure that we're submitting a post before running the code | |
| if ( $entry['post_id'] ){ | |
| foreach ( $entry as $key => $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
| function _otm_clean_phone_number( $number ){ | |
| $phoneNumber = preg_replace('/[^0-9]/','',$number); | |
| if(strlen($phoneNumber) > 10) { | |
| $countryCode = substr($phoneNumber, 0, strlen($phoneNumber)-10); | |
| $areaCode = substr($phoneNumber, -10, 3); | |
| $nextThree = substr($phoneNumber, -7, 3); | |
| $lastFour = substr($phoneNumber, -4, 4); |
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 | |
| // Variables used in this script: | |
| // $summary - text title of the event | |
| // $datestart - the starting date (in seconds since unix epoch) | |
| // $dateend - the ending date (in seconds since unix epoch) | |
| // $address - the event's address | |
| // $uri - the URL of the event (add http://) | |
| // $description - text description of the event | |
| // $filename - the name of this file for saving (e.g. my-event-name.ics) | |
| // |
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 adjust_header_banner(){ | |
| var footer = $('.footer'); | |
| count = 0; | |
| totalWidth = 0; | |
| // Calculate distance between partner images | |
| $('.partners img').each(function() { | |
| totalWidth += $(this).width(); | |
| count += 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
| /** | |
| * Keep a failed login attempt on the same page instead of re-directing to backend | |
| * @access public | |
| * @since 0.1.0 | |
| */ | |
| add_action( 'wp_login_failed', 'my_front_end_login_fail' ); // hook failed login | |
| function my_front_end_login_fail( $username ) { | |
| $referrer = $_SERVER['HTTP_REFERER']; // where did the post submission come from? | |
| if ( !empty($referrer) && !strstr($referrer,'wp-login') && !strstr($referrer,'wp-admin') ) { |
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
| /** | |
| * Remove admin bar & admin access for non-managers & non-admins | |
| * @access public | |
| * @since 0.1.0 | |
| */ | |
| add_action('admin_init', 'no_mo_dashboard'); | |
| add_action('after_setup_theme', 'remove_admin_bar'); | |
| function no_mo_dashboard() { | |
| if ( ! current_user_can( 'edit_others_posts' ) && '/wp-admin/admin-ajax.php' != $_SERVER['PHP_SELF'] ) { | |
| wp_redirect( site_url() ); exit; |
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_filter('gform_pre_render_3', 'populate_fields_contact'); // Document Form | |
| function populate_fields_contact( $form ){ | |
| // Make sure we're editing the object correctly | |
| if ( $_GET['update_contact'] ){ | |
| // Set our default values | |
| $data_type = "contact"; | |
| $data_type_length = 8; // 'contact_' = 8 char |
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 make_comparer() { | |
| // Normalize criteria up front so that the comparer finds everything tidy | |
| $criteria = func_get_args(); | |
| foreach ($criteria as $index => $criterion) { | |
| $criteria[$index] = is_array($criterion) | |
| ? array_pad($criterion, 3, null) | |
| : array($criterion, SORT_ASC, null); | |
| } | |
| return function($first, $second) use (&$criteria) { |
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
| *, *:before, *:after { | |
| -moz-box-sizing: border-box; | |
| -webkit-box-sizing: border-box; | |
| box-sizing: border-box; | |
| } |
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
| /* Basic Selectors */ | |
| #name /* <div id='name'> */ | |
| .name{} /* <div class='name'> */ | |
| .parent.name{} /* <div class='parent name'> */ | |
| .parent .child{} /* Child Element <div class='parent'> <div class='child'> */ | |
| .parent > .child{} /* Direct Child Element ONLY (grandchildren will be ignored) */ | |
| .one + .two{} /* Directly Adjoining Elements <div class='one'></div> <div class='two'></div> */ | |
| .one ~ .two{} /* Any Following Elements */ | |
| /* dynamic selectors */ |