This file contains hidden or 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_filter( | |
'wp_get_attachment_image_attributes', | |
function( $attr, $attachment, $size ) { | |
if ( is_array( $attr ) && isset( $attr['sizes'] ) ) { | |
unset( $attr['sizes'] ); | |
} | |
return $attr; | |
}, | |
10, |
This file contains hidden or 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 | |
/** | |
* filter field named "foo" | |
*/ | |
add_filter( | |
'orphan_replace_acf', | |
function( $filter, $value, $post_id, $field ) { | |
/** | |
* check by field name | |
*/ |
This file contains hidden or 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
#!/usr/bin/env bash | |
# | |
# emails list, one per line | |
# | |
list=./list.txt | |
# | |
# gravatar size | |
# | |
size=2500 | |
# |
This file contains hidden or 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
50c50 | |
< add_action( 'save_post', [ $this, 'save_product_data' ], 1, 3 ); | |
--- | |
> add_action( 'save_post', [ $this, 'save_product_data' ], 1 ); | |
875,877c875,878 | |
< public function save_product_data( $post_id, $post, $update ) { | |
< if ( isset( $post ) && 'product' === $post->post_type && $post_id ) { | |
< $product = wc_get_product( $post_id ); | |
--- | |
> public function save_product_data() { |
This file contains hidden or 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 | |
/** | |
* Zmiana domyślnych sierotek | |
* | |
* https://wordpress.org/support/topic/zmiana-domyslnych-sierotek/ | |
* | |
* Chcę zamienić całą listę domyślnych sierotek na tylko te zaproponowane | |
* przeze mnie (a, i, o, u, w, z ). | |
* |
This file contains hidden or 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
<ifmodule mod_deflate.c> | |
# Compress HTML, CSS, JavaScript, Text, XML and fonts | |
AddOutputFilterByType DEFLATE image/svg+xml | |
AddOutputFilterByType DEFLATE application/javascript | |
AddOutputFilterByType DEFLATE application/rss+xml | |
AddOutputFilterByType DEFLATE application/vnd.ms-fontobject | |
AddOutputFilterByType DEFLATE application/x-font | |
AddOutputFilterByType DEFLATE application/x-font-opentype | |
AddOutputFilterByType DEFLATE application/x-font-otf | |
AddOutputFilterByType DEFLATE application/x-font-truetype |
This file contains hidden or 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_filter( | |
'wp_get_attachment_image_attributes', | |
function( $attr, $attachment, $size ) { | |
if ( ! is_singular() ) { | |
return $attr; | |
} | |
if ( isset( $attr['alt'] ) && ! empty( $attr['alt'] ) ) { | |
return $attr; | |
} |
This file contains hidden or 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 | |
/* | |
Plugin Name: iWorks Default Gallery Link | |
Plugin URI: http://iworks.pl/ | |
Description: Set "file" as default gallery link. | |
Version: 1.0.0 | |
Author: Marcin Pietrzak | |
Author URI: http://iworks.pl/ | |
License: GPLv2 or later | |
License URI: http://www.gnu.org/licenses/gpl-2.0.html |
This file contains hidden or 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_action( 'init', 'create_post_type' ); | |
function create_post_type() { | |
register_post_type( 'book', | |
array( | |
'labels' => array( | |
'name' => __( 'Books', 'book-post-type' ), | |
'singular_name' => __( 'Book', 'book-post-type' ) | |
), | |
'public' => true, |
NewerOlder