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_filter('wc_session_expiring', 'filter_ExtendSessionExpiring' ); | |
add_filter('wc_session_expiration' , 'filter_ExtendSessionExpired' ); | |
function filter_ExtendSessionExpiring($seconds) { | |
return 60 * 60 * 71; | |
} | |
function filter_ExtendSessionExpired($seconds) { | |
return 60 * 60 * 72; | |
} |
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
/** | |
* Optimize WooCommerce Scripts | |
* Remove WooCommerce Generator tag, styles, and scripts from non WooCommerce pages. | |
*/ | |
add_action( 'wp_enqueue_scripts', 'child_manage_woocommerce_styles', 99 ); | |
function child_manage_woocommerce_styles() { | |
//remove generator meta tag | |
remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) ); |
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
CREATE TABLE `wp_yoast_seo_links` ( | |
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, | |
`url` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, | |
`post_id` bigint(20) unsigned NOT NULL, | |
`target_post_id` bigint(20) unsigned NOT NULL, | |
`type` varchar(8) COLLATE utf8mb4_unicode_ci NOT NULL, | |
PRIMARY KEY (`id`), | |
KEY `link_direction` (`post_id`,`type`) | |
) DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; |
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
#!/bin/bash | |
# | |
# This script configures WordPress file permissions based on recommendations | |
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions | |
# | |
# Author: Michael Conigliaro <mike [at] conigliaro [dot] org> | |
# | |
WP_OWNER=www-data # <-- wordpress owner | |
WP_GROUP=www-data # <-- wordpress group | |
WP_ROOT=$1 # <-- wordpress root directory |
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
/** | |
* Based on work from krasimirtsonev | |
* | |
* http://krasimirtsonev.com/blog/article/csssteal-chrome-extension-that-extracts-css | |
*/ | |
// helper function for transforming | |
// node.children to Array | |
function toArray (obj, ignoreFalsy) { | |
var arr = [], i; |
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
function have_https_for_media( $url ) { | |
if ( is_ssl() ) | |
$url = str_replace( 'http://', 'https://', $url ); | |
return $url; | |
} | |
add_filter( 'wp_get_attachment_url', 'have_https_for_media' ); |
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
/** | |
* Gravity Wiz // Gravity Forms // Populate Field from One Page to Field in Subsequent Page | |
* http://gravitywiz.com/ | |
*/ | |
// update "1074" to the ID of your form | |
add_filter( 'gform_pre_render_1074', function( $form ) { | |
foreach( $form['fields'] as &$field ) { | |
// update "2" to the field ID on the later page |
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 mail_from() { | |
$emailaddress = '[email protected]'; | |
return $emailaddress; | |
} | |
function mail_from_name() { | |
$sendername = "1stWebDesigner.com - Dainis"; | |
return $sendername; | |
} |
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 clear_jetpack_published() { | |
if(empty($_REQUEST['post'])) { | |
wp_die(__('Invalid post ID or action')); | |
} | |
global $wpdb; | |
$id = isset($_REQUEST['post']) ? absint($_REQUEST['post']) : ''; |