This is a resource list that will help anyone who relies/relied on jQuery to start transitioning (where possible, where appropriate) to vanilla js.
This file contains 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 | |
// Prefetch For Speed Up | |
function dns_prefetch() { | |
$prefetch = 'on'; | |
echo "\n <!-- DNS Prefetching Start --> \n"; | |
echo '<meta http-equiv="x-dns-prefetch-control" content="'.$prefetch.'">'."\n"; | |
if ($prefetch != 'on') { |
This file contains 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 | |
switch( $_SERVER['SERVER_NAME']) | |
{ | |
// Dev | |
case 'dev.example.com': | |
define('WP_DEBUG', true); | |
define('WP_DEBUG_LOG', true); | |
define('ENV', 'dev'); | |
break; |
This file contains 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
/********************************** | |
* | |
* Move WooCommerce Price on Single Product Page | |
* | |
* @author AlphaBlossom / Tony Eppright | |
* @link http://www.alphablossom.com | |
* | |
* Reference hook locations using woocommerce_single_product_summary hook | |
* | |
* @hooked woocommerce_template_single_title – 5 |
This file contains 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','pluginname_ajaxurl'); | |
function pluginname_ajaxurl() { | |
?> | |
<script type="text/javascript"> | |
var ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>'; | |
</script> | |
<?php | |
} | |
//functions.php code |
This file contains 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
#For files | |
sudo find . -type f -exec chmod 664 {} + | |
#For Directories | |
sudo find . -type d -exec chmod 775 {} + | |
#For the Config File | |
sudo chmod 660 wp-config.php |
This file contains 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('wp_head','pluginname_ajaxurl'); | |
function pluginname_ajaxurl() { | |
?> | |
<script type="text/javascript"> | |
var ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>'; | |
</script> | |
<?php |
This file contains 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
// Enable WP_DEBUG mode | |
define( 'WP_DEBUG', true ); | |
// Enable Debug logging to the /wp-content/debug.log file | |
define( 'WP_DEBUG_LOG', true ); | |
// Disable display of errors and warnings | |
define( 'WP_DEBUG_DISPLAY', false ); | |
@ini_set( 'display_errors', 0 ); |
This file contains 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 get_youtube_video_ID($youtube_video_url) { | |
/** | |
* Pattern matches | |
* http://youtu.be/ID | |
* http://www.youtube.com/embed/ID | |
* http://www.youtube.com/watch?v=ID | |
* http://www.youtube.com/?v=ID | |
* http://www.youtube.com/v/ID | |
* http://www.youtube.com/e/ID |
I hereby claim:
- I am leogopal on github.
- I am leogopal (https://keybase.io/leogopal) on keybase.
- I have a public key ASByfyq6t9rfWSsYlbC8ER86XnzBa_QkUXLg_jq90m9YTgo
To claim this, I am signing this object:
OlderNewer