Skip to content

Instantly share code, notes, and snippets.

View trueqap's full-sized avatar
🎯
Focusing

TrueQAP trueqap

🎯
Focusing
View GitHub Profile
@trueqap
trueqap / woocommerce_add_order_page_date_and_time.php
Created January 28, 2018 07:24
Modify the WooCommerce order date column with time (date + time)
<?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 January 28, 2018 14:56
WordPress child theme example 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 July 14, 2019 00:38
WordPress Child theme example 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 January 31, 2018 07:06
WordPress admin mappa átnevezése
<?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 January 31, 2018 07:13
Wp-admin -> beallitasok
<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]
@trueqap
trueqap / plugin_row_meta
Created February 5, 2018 17:23
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>'
);
@trueqap
trueqap / mod_gzip_on
Created February 27, 2018 09:09
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 March 20, 2018 19:35
/wp-content/mu-plugins/swift-performance-loader.php
<?php
/**
* Plugin Name: Swift Performance early loader
*/
class Swift_Performance_Loader {
public static function load(){
wp_cookie_constants();
<?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
}
}