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
| Script put on HEAD | |
| <!-- Google tag (gtag.js) --> | |
| <script async src="https://www.googletagmanager.com/gtag/js?id=TAG_ID"></script> | |
| <script> | |
| window.dataLayer = window.dataLayer || []; | |
| function gtag(){dataLayer.push(arguments);} | |
| gtag('js', new Date()); | |
| gtag('config', 'TAG_ID'); | |
| </script> |
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
| from selenium import webdriver | |
| from selenium.common.exceptions import WebDriverException | |
| from selenium.webdriver.common.by import By | |
| from tqdm import tqdm | |
| import time | |
| lines = [] | |
| Links_File = r'' | |
| OP_DIR = r'' | |
| i = 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
| <?php | |
| /** | |
| * Populating Product Attributes | |
| */ | |
| add_filter('acf/load_field/name=woo_admin_attributes', 'dc_acf_product_attribute'); | |
| function dc_acf_product_attribute($field){ | |
| $product_taxonomies = get_taxonomies([ | |
| '_builtin' => false, | |
| ]); |
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 | |
| /** | |
| * Gravity Form spinner | |
| */ | |
| add_action("gform_enqueue_scripts", "dc_gform_spinner", 10, 2); | |
| function dc_gform_spinner($form, $is_ajax){ | |
| $new_spinner = array("spinnerUrl":"[my_spinner_url]"); | |
| wp_localize_script('gform_gravityforms', 'gf_global', $new_spinner); | |
| } |
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('woocommerce_order_item_name', 'dc_product_image_on_thankyou_myacount', 10, 3); | |
| function dc_product_image_on_thankyou_myacount($name, $item, $visible){ | |
| if(!$visible){ | |
| return $name; | |
| } | |
| if(!is_order_received_page() && !is_account_page()){ | |
| return $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
| name: 🚚 Create Archive | |
| on: [ push ] | |
| jobs: | |
| web-deploy: | |
| name: 🎉 Deploy | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: 🚚 Get latest code | |
| uses: actions/checkout@v2 |
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 | |
| /** | |
| * Plugin Requirements | |
| */ | |
| add_action('admin_notices', 'dc_theme_dependencies'); | |
| function dc_theme_dependencies(){ | |
| if(!is_plugin_active('framework_plugin/framework_plugin.php')){ | |
| echo '<div class="error"><p>' . __('The current theme requires plugin [Your Plugin Name], please install and activate [Your Plugin Name] plugin', 'dc') . '</p></div>'; | |
| } |
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 | |
| /** | |
| * Update enqueued resource in WordPress | |
| */ | |
| add_filter('script_loader_src', 'dc_update_resource_urls', 9999, 2); | |
| function dc_update_resource_urls($src, $handle){ | |
| // check if it's my theme scripts and it's not the minified files | |
| if(!is_admin() && strpos($handle, THEME_PREFIX) !== false && strpos($src, 'min.js') === false){ | |
| // do the replacement | |
| $src = str_replace('.js', '.min.js', $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
| <?php | |
| /** | |
| * Remove image srcset | |
| */ | |
| add_filter('wp_calculate_image_srcset', 'dc_remove_srcset'); | |
| function dc_remove_srcset(){ | |
| return false; | |
| } |
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 | |
| /** | |
| * Delete orphaned files in wp-content/uploads that are not WordPress attachments | |
| */ | |
| add_action('dc_clean_orphaned_uploads', 'dc_clean_orphaned_uploads', 10, 0); | |
| function dc_clean_orphaned_uploads(){ | |
| $uploads_dir = wp_upload_dir(); | |
| $search = $uploads_dir['basedir']; | |
| $replace = $uploads_dir['baseurl']; |
NewerOlder