Skip to content

Instantly share code, notes, and snippets.

@Musilda
Musilda / gist:d79e49ae84839fa17d8689aa24951b96
Created October 11, 2023 03:25
gitignore-for-wordpress.txt
### WordPress Core ###
wp-includes/*
wp-admin/*
wp-content/uploads/*
wp-content/languages/*
wp-content/blogs.dir/
wp-content/upgrade/
wp-content/backup-db/
wp-content/advanced-cache.php
wp-content/wp-cache-config.php
var actionUrl = 'action=tls_send_data&value1=value;
var request = new XMLHttpRequest();
request.open('POST', 'http://www.mysite.com/wp-admin/admin-ajax.php', true);
request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded;');
request.onload = function () {
if (this.status >= 200 && this.status < 400) {
console.log( this.response );
// If successful
var value = JSON.parse( this.response );
<?php
$password = 'xxxxxxx';
$wsdlUrl = 'https://xxxxxx:xxxx/xxxx/CardServiceWs?WSDL';
$pemFilePath = PATHDIR . 'client.pem';
$pemPassword = 'xxxxxxxxxxxxx';
$contextOptions = array(
'ssl' => array(
'verify_peer' => false,
'verify_peer_name' => false,
<?php
add_action( 'pre_get_posts', 'apply_akce_query_filter' );
function apply_akce_query_filter ( $query )
{
if ( is_admin() ) {
return $query;
}
if ( is_single() ) {
<ol>
<li>mu_plugin_loaded</li>
<li>muplugins_loaded</li>
<li>registered_taxonomy</li>
<li>registered_post_type</li>
<li>plugin_loaded</li>
<li>load_textdomain</li>
<li>elementor/loaded</li>
<li>woocommerce_helper_loaded</li>
<li>wpseo_loaded</li>
<?php
add_shortcode( 'tatum_minted_address', 'tatum_get_minted_address' );
function tatum_get_minted_address() {
$html = '';
if ( !empty( $_GET['order'] ) ) {
$order_id = (int)$_GET['order'];
$order = wc_get_order( $order_id ) {
if ( is_object( $order ) ) {
<?php
add_filter( 'woocommerce_thankyou_order_received_text', 'gunshop_received_text', 10, 2 );
function gunshop_received_text( $text, $order ){
$payment = $order->get_payment_method();
if ( 'dobirka' === $payment ) {
$text = 'Děkujeme za objednávku, zboží zaplatíte až při převzetí.';
}
<?php
add_action( 'woocommerce_before_shop_loop', 'metaltrade_categories', 5 );
function metaltrade_categories(){
global $wp_query;
if( empty( $wp_query->queried_object->term_id ) ){
$parent = 0;
} else {
$parent = $wp_query->queried_object->term_id;
function no_wordpress_errors(){
return 'Something is wrong!';
}
add_filter( 'login_errors', 'no_wordpress_errors' );
<?php
global $wpdb;
$posts = $wpdb->get_results(
"SELECT wposts.*
FROM ".$wpdb->prefix."posts wposts, ".$wpdb->prefix."icl_translations wicl_translations
WHERE wicl_translations.element_id = wposts.ID
AND wposts.post_status = 'publish'
AND wicl_translations.language_code = 'en'
AND wicl_translations.element_type = 'post_post'