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 | |
/* CSS im Cusomizer erweitern, Steuerelemente verbreitern */ | |
add_action( 'customize_controls_print_styles', 'customizer_width', 999 ); | |
function customizer_width() { | |
?> | |
<style> | |
#customize-controls { | |
width:400px; | |
max-width:400px; | |
} |
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 | |
/* | |
Quelle: Zeile 11: Thomas Weiland, http://www.weiland-thomas.de, 2016 | |
GNU General Public License | |
Modifiziert: René A. Da Rin, www.darin.ch, 29.1.2019 | |
*/ | |
// Die Funktion radLastChange() zeigt Datum und Uhrzeit der letzten Änderung an. | |
add_shortcode('rad-last-change', 'radLastChange'); | |
function radLastChange() { | |
global $wpdb; |
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 | |
//check if role exists before removing it | |
if( get_role('entwurfsautor') ){ | |
remove_role( 'entwurfsautor' ); | |
} | |
?> |
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_role( | |
'entwurfsautor', | |
__( 'Entwurfsautor' ), | |
array( | |
'read' => true, // true allows this capability | |
'edit_posts' => true, | |
'delete_posts' => true, | |
'upload_files' => true, | |
'edit_published_posts' => 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 | |
// Quelle: SnowCrash | |
// Funktion | |
function generatePW($length=8) | |
{ | |
// Zu verwendende Zeichen definieren | |
$dummy = array_merge(range('0', '9'), range('a', 'z'), range('A', 'Z'), array('#','&','@','$','_','%','?','+')); | |
// Array zufaellig fuellen |
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 | |
// Allgemeine PHP-Variante | |
add_shortcode( 'randompic', 'rad_randompic' ); | |
$vn = "./static-img/randompic"; | |
$html_vn = "static-img/randompic/"; | |
$barray = array(1,2,3,4,5); | |
$verzeichnis = opendir($vn); | |
while($file = readdir($verzeichnis)) { | |
$s = @getimagesize($vn."/".$file); | |
if(in_array($s[2], $barray)) |
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 | |
// Code folgt... | |
?> |