Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

TrueQAP trueqap

🎯
Focusing
View GitHub Profile
@trueqap
trueqap / woocommerce_add_order_page_date_and_time.php
Created Jan 28, 2018
Modify the WooCommerce order date column with time (date + time)
View woocommerce_add_order_page_date_and_time.php
<?php
//https://woopress.hu/forumok/tema/rende/
function woocommerce_add_order_page_date_and_time($h_time)
{
return get_the_time(__('Y/m/d G:i', 'woocommerce'));
}
add_filter('woocommerce_admin_order_date_format', 'woocommerce_add_order_page_date_and_time');
@trueqap
trueqap / style.css
Created Jan 28, 2018
WordPress child theme example css
View style.css
/*
Theme Name: Twenty Fifteen Child
Theme URI: http://example.com/twenty-fifteen-child/
Description: Twenty Fifteen Child Theme
Author: John Doe
Author URI: http://example.com
Template: twentyfifteen
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
@trueqap
trueqap / functions.php
Last active Jul 14, 2019
WordPress Child theme example functions.php
View functions.php
<?php
add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
function my_theme_enqueue_styles() {
wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
}
?>
@trueqap
trueqap / admin.php
Created Jan 31, 2018
WordPress admin mappa átnevezése
View admin.php
<?php
function my_custom_admin_url($path) {
return str_replace('wp-admin', 'beallitasok', $path);
}
add_filter('admin_url', 'my_custom_admin_url');
@trueqap
trueqap / .htaccess
Created Jan 31, 2018
Wp-admin -> beallitasok
View .htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^beallitasok[^/]*$ beallitasok/ [R=301,L]
RewriteCond %{QUERY_STRING} (.*)$
RewriteRule ^beallitasok(.*)$ wp-admin$1? [QSA,L,NE]
RewriteCond %{QUERY_STRING} (.*)$
RewriteRule ^wp-admin/?$ / [NE,R=404,L]
RewriteCond %{QUERY_STRING} (.*)$
RewriteRule ^wp-admin/(.*)$ beallitasok/$1 [QSA,R=301,L,NE]
View plugin_row_meta
add_filter( 'plugin_row_meta', 'custom_plugin_row_meta', 10, 2 );
function custom_plugin_row_meta( $links, $file ) {
if ( strpos( $file, 'plugin-file-name.php' ) !== false ) {
$new_links = array(
'donate' => '<a href="donation_url" target="_blank">Donate</a>',
'doc' => '<a href="doc_url" target="_blank">Documentation</a>'
);
View mod_gzip_on
<ifModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file .(html?|txt|css|js|php|pl)$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text/.*
mod_gzip_item_include mime ^application/x-javascript.*
mod_gzip_item_exclude mime ^image/.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</ifModule>
@trueqap
trueqap / swift-performance-loader.php
Last active Mar 20, 2018
/wp-content/mu-plugins/swift-performance-loader.php
View swift-performance-loader.php
<?php
/**
* Plugin Name: Swift Performance early loader
*/
class Swift_Performance_Loader {
public static function load(){
wp_cookie_constants();
View mem.php
<?php
$memory_limit = ini_get('memory_limit');
if (preg_match('/^(\d+)(.)$/', $memory_limit, $matches)) {
if ($matches[2] == 'M') {
$memory_limit = $matches[1] * 1024 * 1024; // nnnM -> nnn MB
} else if ($matches[2] == 'K') {
$memory_limit = $matches[1] * 1024; // nnnK -> nnn KB
}
}
View Waze Deep link
You can’t perform that action at this time.