Skip to content

Instantly share code, notes, and snippets.

View christoferw's full-sized avatar

Christofer Wesseling christoferw

View GitHub Profile
// This is a test harness for your module
// You should do something interesting in this harness
// to test out the module and to provide instructions
// to users on how to use it by example.
// open a single window
var win = Ti.UI.createWindow({
backgroundColor:'white'
});
<?php
$sites = "http://www.broadcastsolutions.com.au/
http://www.kvm.com.au/
http://www.ambertech.com.au/";
$sites = preg_split('/\r\n|\r|\n/', $sites);
echo "
@christoferw
christoferw / inputdate.css
Created August 3, 2016 08:02
Placeholder for Input type: date
input[type="date"]:before {
content: attr(placeholder) !important;
color: #aaa;
margin-right: 0.5em;
}
input[type="date"]:focus:before,
input[type="date"]:valid:before {
content: "";
}
@christoferw
christoferw / remove_admin_menu_items_stage_1.php
Created August 12, 2016 10:32
Remove WordPress Admin Menu Items
if ( ! function_exists( 'weslink_remove_plugin_admin_menu' ) ) {
function weslink_remove_plugin_admin_menu() {
remove_menu_page('edit-comments.php'); // Kommentare
}
}
add_action( 'admin_menu', 'weslink_remove_plugin_admin_menu', 9999 );
@christoferw
christoferw / remove_admin_menu_items_full_list.php
Last active August 12, 2016 10:56
Remove Admin Menu Items Fill List
if ( ! function_exists( 'weslink_remove_plugin_admin_menu' ) ) {
function weslink_remove_plugin_admin_menu() {
remove_menu_page('edit.php'); // Beiträge
remove_menu_page('edit.php?post_type=CustomPostType'); // Custom Post Types
remove_menu_page('upload.php'); // Medien
remove_menu_page('edit-comments.php'); // Kommentare
remove_menu_page('plugins.php'); // Plugins
remove_menu_page('themes.php'); // Design
remove_menu_page('users.php'); // Benutzer
remove_menu_page('tools.php'); // Werkzeuge
@christoferw
christoferw / functions.php
Created October 7, 2016 08:47
WordPress Function to gain admin rights through ftp
if ( ! function_exists( 'weslink_wordpress_admin_account' ) ) {
function weslink_wordpress_admin_account() {
// Hier setzen Sie ihre neuen Daten fest
$username = 'Benutzername';
$password = 'Passwort';
$email = 'email@ihre-domain.de';
// Ab hier müssen Sie nichts mehr machen
if ( ! username_exists( $username ) && ( ! email_exists( $email ) ) ) {
$user_id = wp_create_user( $username, $password, $email );
@christoferw
christoferw / functions.php
Created November 4, 2016 09:07
Change WordPress login error message
if ( ! function_exists( 'weslink_change_wordpress_errors' ) ) {
function weslink_change_wordpress_errors(){
return 'Irgendetwas ist hier falsch!'; // Hier kann man eine beliebige Fehlermeldung ausgeben
}
}
add_filter( 'login_errors', 'weslink_change_wordpress_errors' );
@christoferw
christoferw / functions.php
Last active August 4, 2017 14:53
Disable WordPress Core Update Notification
if ( function_exists('wl_stop_update_emails')) {
add_filter( 'auto_core_update_send_email', 'wl_stop_auto_update_emails', 10, 4 );
function wl_stop_update_emails( $send, $type, $core_update, $result ) {
if ( ! empty( $type ) && $type == 'success' ) {
return false;
}
@christoferw
christoferw / .htaccess
Created September 3, 2018 13:03
WordPress htaccess
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
@christoferw
christoferw / .htaccesshtaccess
Created September 3, 2018 13:08
htaccess für Wordpress: Caching und Komprimierung
## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/svg+xml "access plus 1 month"
#ExpiresByType text/css "access plus 1 day"
#ExpiresByType text/html "access plus 1 day"