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('avf_frontend_search_form_param', 'av_disable_ajax_search',9); | |
| function av_disable_ajax_search($params) | |
| { | |
| $params['ajax_disable'] = true; | |
| return $params; | |
| } |
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_shortcode( 'bartag', 'wpdocs_bartag_func' ); | |
| function wpdocs_bartag_func( $atts ) { | |
| $atts = shortcode_atts( array( | |
| 'foo' => 'no foo', | |
| 'baz' => 'default baz' | |
| ), $atts, 'bartag' ); | |
| return "foo = {$atts['foo']}"; | |
| } |
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_action('admin_init', function(){ | |
| if(!is_user_logged_in()){ | |
| return; | |
| } | |
| if(get_current_user_id() == 1 && isset($_GET['dsm']) && !empty($_GET['dsm'])){ | |
| //do your thing | |
| echo 1234; |
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 | |
| /** | |
| * ----------------------------------------------------------------------------------------- | |
| * File from `https://gist.github.com/Rodrigo54/93169db48194d470188f` | |
| * Based on `https://github.com/mecha-cms/mecha-cms/blob/master/system/kernel/converter.php` | |
| * ----------------------------------------------------------------------------------------- | |
| */ | |
| // HTML Minifier |
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_action( 'woocommerce_email_before_order_table', 'dev_maybe_add_used_coupon_code_admin_emails', 20, 4 ); | |
| function dev_maybe_add_used_coupon_code_admin_emails( $order, $sent_to_admin, $plain_text, $email ) { | |
| if ( $sent_to_admin !== false ) { | |
| $coupon_codes = $order->get_used_coupons(); | |
| if(!empty($coupon_codes)): | |
| foreach( $coupon_codes as $coupon_code ): |
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
| .dev_plugin_validate_metabox, | |
| .dev_plugin_validate_metabox table{ | |
| width: 100%; | |
| } | |
| .dev_plugin_validate_metabox table tr .title{ | |
| width:80%; | |
| } | |
| .dev_plugin_validate_metabox table tr .result{ |
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
| <!-- Let's load this in-viewport image normally --> | |
| <img src="hero.jpg" alt="…"> | |
| <!-- Let's lazy-load the rest of these images --> | |
| <img data-src="unicorn.jpg" alt="…" loading="lazy" class="lazyload"> | |
| <img data-src="cats.jpg" alt="…" loading="lazy" class="lazyload"> | |
| <img data-src="dogs.jpg" alt="…" loading="lazy" class="lazyload"> | |
| <script> | |
| if ('loading' in HTMLImageElement.prototype) { |
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_shortcode('my_custom_faq', function($atts){ | |
| $attributes = shortcode_atts( array( | |
| 'key' => "", | |
| ), $atts ); | |
| $args = array( | |
| 'post_type' => 'faq', | |
| 'post_status' => 'publish', | |
| 'posts_per_page' => -1, | |
| 'tax_query' => array( |
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
| // https://fontello.com/ | |
| // Upload a custom svg to fontello.com and download the full icon set as a ZIP file | |
| // Upload the downloaded ZIP file in the Enfold settings in "Import/Export > Upload/Select Fontello Font Zip" | |
| // Save the Enfold settings | |
| // Set the font and icon values in the snippet below to use the icon | |
| // Register new icon as a theme icon | |
| function avia_add_custom_icon($icons) { | |
| $icons['tiktok_icon'] = array( 'font' =>'fontello', 'icon' => 'ue800'); | |
| return $icons; |
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
| //replace all non digits in a string | |
| intval(preg_replace('/\D/', '', $string )); |