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 | |
| /** | |
| * Modern Tribe's The Event Calendar plugin would be much faster in the editing interface | |
| * if it removed the upfront loading of organizers and venues from the select dropdown and | |
| * relied on AJAX loading after initial page load. Additional improvement would be to drop | |
| * the `get_the_title` method when displaying the venue and organizer titles in the list. | |
| * This was tested on a production site with ~4500+ events. Average of 10 attempts time to | |
| * load edit screen prior to modification 47.2 seconds with memory load 290.63mb and | |
| * 18,968 queries. In contrast after modification 16.88 seconds with memory load 217.89mb | |
| * and 155 queries. |
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 | |
| // look at line 69 and change | |
| $field = 'eventStart.meta_value'; | |
| // to | |
| $field = 'tribe_event_start_date.meta_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
| <?php | |
| /** | |
| * Filter Gravity Forms select field display to wrap optgroups where defined | |
| * USE: | |
| * set the value of the select option to `optgroup` within the form editor. The | |
| * filter will then automagically wrap the options following until the start of | |
| * the next option group | |
| */ |
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
| angular.module('SampleApp', ['ngRoute']) | |
| .filter('filterByProperty', function(){ | |
| return function( items, propMatch ){ | |
| var filtered = []; | |
| for (var i = 0; i < items.length; i++) { | |
| var item = items[i]; | |
| for(var property in propMatch){ | |
| if (propMatch[property] == item[property]) { |
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
| .filter('filterByProperty', function(){ | |
| return function( items, propMatch ){ | |
| var filtered = []; | |
| for (var i = 0; i < items.length; i++) { | |
| var item = items[i]; | |
| for(var property in propMatch){ | |
| if (propMatch[property] == item[property]) { | |
| filtered.push(item); | |
| } | |
| } |
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 | |
| /** | |
| * implement a filter hook by replacing the original echo in | |
| * serieslistings.php lines 621, 727 | |
| * ajaxlink.php lines 632, 746 | |
| */ | |
| echo stripslashes($enmse_singlemessage->embed_code); | |
| // with the new filter |
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 | |
| function ping($host){ | |
| if(exec('echo EXEC') == 'EXEC'){ | |
| exec(sprintf('ping -c 1 -W 5 %s', escapeshellarg($host)), $res, $rval); | |
| } elseif( function_exists('fsocketopen') ){ | |
| $port = 80; | |
| $timeout= 6; | |
| $fsock = fsockopen($host, $port, $errno, $errstr, $timeout); | |
| if ( ! $fsock ){ |
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 | |
| add_filter( 'gform_field_value_user_name', 'my_custom_gform_field_user_name' ); | |
| function my_custom_gform_field_user_name( $value ){ | |
| $current_user = wp_get_current_user(); | |
| if ( 0 != $current_user->ID ) { | |
| $value = $current_user->display_name; | |
| } | |
| return $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
| <?php | |
| /** | |
| * WordPress automatically adds query strings to enqueued static resources like stylesheets and scripts. | |
| * This is meant for caching reasons (e.g. if a script version changes, | |
| * it should prevent the client to use a cached copy of the old one). | |
| * However, this feature can be omitted to improve site performance. | |
| */ | |
| function remove_query_strings_questionmark( $src ){ |
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
| <html> | |
| <head> | |
| <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> | |
| </head> | |
| <body> | |
| <div id="floatingSearchWrap"> | |
| <span class="lookup"> | |
| <input type="text" name="s" placeholder="Search..." /> | |
| <button class="clear"> | |
| <img src="search-delete.svg" alt="Click to clear search"> |