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
(function( $ ) { | |
var acfPlugin; | |
//http://stackoverflow.com/a/965962 | |
jQuery.expr[':'].parents = function(a,i,m){ | |
return jQuery(a).parents(m[3]).length < 1; | |
}; | |
var AcfPlugin = function() { |
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
( function ( $ ) { | |
$( function () { | |
/** | |
* Раскрывает первый элемент виджета Toggle по умолчанию. | |
*/ | |
$( '.elementor-toggle-item:first-child' ) | |
.children( '.elementor-tab-title' ) | |
.addClass( 'elementor-active' ) | |
.attr({ | |
'aria-expanded': 'true', |
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 | |
/** | |
* The Shortcode | |
*/ | |
function ebor_skills_shortcode( $atts, $content = null ) { | |
$output = '<div class="skills-wrapper">'. do_shortcode($content) .'</div>'; | |
return $output; | |
} | |
add_shortcode( 'machine_skills', 'ebor_skills_shortcode' ); |
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 | |
/** | |
* The Shortcode | |
*/ | |
function ebor_skills_shortcode( $atts, $content = null ) { | |
$output = '<div class="skills-wrapper">'. do_shortcode($content) .'</div>'; | |
return $output; | |
} | |
add_shortcode( 'machine_skills', 'ebor_skills_shortcode' ); |
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: Auto Post Thumbnail | |
* Author: [email protected] | |
*/ | |
add_action( | |
'save_post', | |
function ( $post_id, WP_Post $post ) { | |
if ( wp_is_post_revision( $post_id ) || wp_is_post_autosave( $post_id ) ) { | |
return; |
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( | |
'render_block', | |
function ( $block_content, $block ) { | |
if ( 'core/image' === $block['blockName'] ) { | |
$block_content = str_replace( | |
array( '<figure ', '</figure>' ), | |
array( '<p ', '</p>' ), | |
$block_content | |
); |
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 | |
/** | |
* Делаем alt для Превью поста. Функция автозаполнения alt должна быть отключена в плагинах типа | |
* Webcraftic Clearfy или любом другом, который устанавливает alt автоматически, | |
* так как там всегда генерирует на основе заголовка. | |
* В некоторых темах, например OceanWP alt прописан как заголовок статьи в самой теме, | |
* и там нужно дополнительно кодить. В Astra всё нормально работает | |
* | |
* @param array $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 | |
function mihdan_edit_upload_types( $existing_mimes = array() ) { | |
// allow .woff | |
$existing_mimes['woff'] = 'font/woff'; | |
// disallow .jpg files | |
unset( $existing_mimes['jpg'] ); | |
return $existing_mimes; | |
} |
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( 'template_redirect', 'set_last_modified_headers', 999 ); | |
function set_last_modified_headers() { | |
if ( ( defined( 'DOING_AJAX' ) && DOING_AJAX ) | |
|| ( defined( 'XMLRPC_REQUEST' ) && XMLRPC_REQUEST ) | |
|| ( defined( 'REST_REQUEST' ) && REST_REQUEST ) | |
|| ( is_admin() ) ) { | |
return; |