Skip to content

Instantly share code, notes, and snippets.

View angry-qa's full-sized avatar

AngryQA angry-qa

View GitHub Profile
@angry-qa
angry-qa / .gitignore Java
Created April 28, 2022 20:31 — forked from dedunumax/.gitignore Java
A complete .gitignore file for Java.
##############################
## Java
##############################
.mtj.tmp/
*.class
*.jar
*.war
*.ear
*.nar
hs_err_pid*
@angry-qa
angry-qa / filter_wp_caption_text_v2
Last active December 21, 2018 19:35
Меняет для подписи под картинкой <p class="wp-caption-text"> на <div class="wp-caption-text"> версия через фильтр
add_filter( 'img_caption_shortcode', 'my_img_caption_shortcode', 10, 3 );
function my_img_caption_shortcode( $empty, $attr, $content ){
$attr = shortcode_atts( array(
'id' => '',
'align' => 'alignnone',
'width' => '',
'caption' => ''
), $attr );
@angry-qa
angry-qa / filter_wp_caption_text_v1
Last active December 21, 2018 19:31 — forked from campusboy87/filter_wp_caption_text.php
Меняет для подписи под картинкой <p class="wp-caption-text"> на <div class="wp-caption-text">
<?php
function filter_wp_caption_text( $content ) {
return preg_replace(
'/<p[^>]+class="wp-caption-text"[^>]*>(.+)(?=<\/p>)/s',
'<div class="wp-caption-text">\1</div>',
$content
);
}