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
<select name="countries"> | |
<optgroup label="A"> | |
<option value="AF">Afghanistan</option> | |
<option value="EG">Ägypten</option> | |
<option value="AX">Ålandinseln</option> | |
<option value="AL">Albanien</option> | |
<option value="DZ">Algerien</option> | |
<option value="AS">Amerikanisch-Samoa</option> | |
<option value="VI">Amerikanische Jungferninseln</option> | |
<option value="UM">Amerikanische Überseeinseln</option> |
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 | |
/* | |
Plugin Name: Sanitize File Names | |
Description: extend file name sanitization | |
Author: Gabriele Lässer | |
Version: 1.0 | |
*/ | |
function pppf_extend_filename_sanitization( $title ) { |
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 | |
/* | |
* Plugin Name: PPP Random AMP Image (needs AMP plugin to work!) | |
* Description: Add random category image to amp articles without post_thumbnail. Install and activate <a href="https://de.wordpress.org/plugins/amp/">AMP Plugin</a> first | |
* | |
*/ | |
function pppf_add_media_taxonomy() { | |
$labels = array( |
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 | |
/****************************************** | |
* edit form for new and existing terms | |
* param term_id has no value by default | |
******************************************/ | |
function pppf_term_edit_form( $term_id = '' ) { | |
wp_nonce_field( 'ppp_update_term', 'ppp_update_term_nonce' ); | |
$my_checkbox = $term_id != '' ? get_term_meta( $term_id, 'my_checkbox', true ) : ''; |
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 | |
//Display Fields | |
add_action( 'woocommerce_product_after_variable_attributes', 'variable_fields', 10, 3 ); | |
//Save variation fields | |
add_action( 'woocommerce_save_product_variation', 'save_variable_fields', 10, 2 ); | |
function variable_fields( $loop, $variation_data, $variation ) { | |
// Text Field | |
$text_field = get_post_meta( $variation->ID, '_text_field', true ); |
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
/*********************************** | |
* use in your theme functions.php | |
* or wordpress plugin | |
* correct quotes in multilingual sites | |
* http://codex.wordpress.org/Quicktags_API | |
***********************************/ | |
function pptf_add_german_quotes() { | |
if (wp_script_is('quicktags')) { | |
?> |
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
body { | |
margin:0; | |
padding:0; | |
} | |
* { | |
-webkit-box-sizing: border-box; | |
-moz-box-sizing: border-box; | |
-ms-box-sizing: border-box; | |
-o-box-sizing: border-box; | |
box-sizing: border-box; |
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
/****************************************** | |
* get latest post | |
* use in loop if ( is_latest() ) { stuff; } | |
******************************************/ | |
function is_latest() { | |
global $post; | |
$loop = get_posts( 'numberposts=1' ); | |
$latest = $loop[0]->ID; | |
return ( $post->ID == $latest ) ? true : false; | |
} |