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 onx_reset_faceted_menus () | |
{ | |
if ( isset( $_GET['reset'] ) && class_exists( 'Shopp' ) ) | |
{ | |
// the part of the Shopp Object that holds the facet filtering info, make it empty | |
ShoppStorefront()->browsing = array(); | |
// get the current url | |
$url = explode( '?', onx_full_url() ); | |
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( 'init', 'onx_register_image_sizes' ); | |
function onx_register_image_sizes() | |
{ | |
add_image_size( 'header_screen_large', 2000, 1200, array( 'center', 'center' ), true ); | |
add_image_size( 'header_screen', 991, 700, array( 'center', 'center' ), true ); | |
add_image_size( 'header_tablet', 767, 550, array( 'center', 'center' ) ); | |
add_image_size( 'header_mobile', 479, 400, array( 'center', 'center' ) ); | |
} // end onx_register_image_sizes |
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 | |
if ( ! function_exists( 'get_current_sidebar' ) ) | |
{ | |
function get_current_sidebar ( $widget_id ) | |
{ | |
$sidebars_widgets = get_option('sidebars_widgets', array()); | |
if ( is_array( $sidebars_widgets ) && isset( $sidebars_widgets['array_version'] ) ) | |
unset( $sidebars_widgets['array_version'] ); | |
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 | |
# just add the needed form IDs to the array | |
$forms = array( '6', '7' ); | |
# looping through the array to add an 'add_filter' for each | |
foreach ( $forms as $i => $form ) | |
add_filter( "gform_field_validation_{$form}", 'custom_zip_validation', 10, 4 ); | |
# the function |
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 | |
# Like on: https://docs.gravityforms.com/gform_get_input_value/ | |
add_filter( 'gform_get_input_value', 'gf_custom_decode_field', 10, 4 ); | |
function gf_custom_decrypt_field( $value, $entry, $field, $input_id ) | |
{ | |
return GFCommon::decrypt( $value ); | |
} | |
// end gf_custom_decrypt_field |
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 onx_redirect_edit_page_to_elementor() | |
{ | |
global $post, $pagenow; | |
if ( ! isset( $post->ID ) || current_user_can( 'manage_options' ) ) return; | |
if ( ( ( $pagenow == 'post.php' ) && ( get_post_type() == 'page' ) ) && ( current_user_can( 'editor' ) || current_user_can( 'author' ) ) ) | |
{ |
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_filter( 'template', 'onx_change_theme' ); | |
add_filter( 'option_template', 'onx_change_theme' ); | |
add_filter( 'option_stylesheet', 'onx_change_theme' ); | |
add_filter( 'pre_option_stylesheet', 'onx_change_theme' ); | |
function onx_change_theme( $theme ) | |
{ | |
if ( is_admin() && ( function_exists( 'wp_get_current_user' ) ) ) | |
{ |
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
### Blocking Spammers Section ### | |
# Stop protected folders from being narked. Also helps with spammers | |
ErrorDocument 401 /401.html # this file should be added, check http://halfelf.org/2013/wp-login-protection-htaccess/ | |
# Stop spam attack logins and comments - http://halfelf.org/2013/wp-login-protection-htaccess/ | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteCond %{REQUEST_METHOD} POST | |
RewriteCond %{REQUEST_URI} .(wp-comments-post|wp-login)\.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 | |
function my_custom_gravityforms_encrypt( $to_encrypt ) | |
{ | |
if ( '' === $to_encrypt ) return null; | |
if ( function_exists('openssl_encrypt') && function_exists('openssl_random_pseudo_bytes') ) | |
{ | |
$iv = openssl_random_pseudo_bytes( openssl_cipher_iv_length( 'aes-256-cbc' ) ); | |
$encrypted = openssl_encrypt( $to_encrypt, 'aes-256-cbc', MY_CUSTOM_GF_ENCRYPTION_KEY, 0, $iv ); |