Skip to content

Instantly share code, notes, and snippets.

View nuriye's full-sized avatar

Theresa Schmidt nuriye

View GitHub Profile
pointer-events: none;
if (window.location.href.indexOf("newsletter") > -1) {
console.log(getUrlParameter('vorname'));
}
function getUrlParameter(sParam) {
var sPageURL = window.location.search.substring(1),
sURLVariables = sPageURL.split('&'),
sParameterName,
i;
for (i = 0; i < sURLVariables.length; i++) {
sParameterName = sURLVariables[i].split('=');
if (sParameterName[0] === sParam) {
$str = preg_replace('/\s+/', '', $str);
js:
JSON.stringify(selectedArray)
php:
$selectedArray = json_decode(stripslashes($_GET['selected']));
@nuriye
nuriye / gist:acbd4f47e64a0c067100bdf5e303a99a
Created July 8, 2019 08:30
Scroll smoothly on mobile
-webkit-overflow-scrolling: touch;
$('.product .ajax_add_to_cart').on('click',function(e){
var tokenCart = true;
$( document ).ajaxComplete(function( event, xhr, settings ) {
if(tokenCart) {
getSide('Cart');
}
/****
* Put this in the pdf template
*
***/
add_filter( 'gfpdf_field_html_value', function($html, $value, $show_label, $label, $field, $form, $entry, $class) {
/* Wenn Class "wps-notinpdf" gesetzt ist, wird das Feld vom PDF ausgeschlossen */
if (strpos ($field['cssClass'], 'notinpdf') !== false) {
add_filter( 'vc_gitem_template_attribute_event_button', 'vc_gitem_template_attribute_event_button', 10, 2 );
function vc_gitem_template_attribute_event_button( $value, $data ) {
extract( array_merge( array(
'post' => null,
'data' => '',
), $data ) );
$event_link = get_field( "event_link", $post->ID );
$event_button_text = get_field( "event_button_text", $post->ID );