This file contains 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 | |
/** | |
* Created by PhpStorm. | |
* User: tim | |
* Date: 2/5/18 | |
* Time: 10:56 PM | |
*/ | |
add_filter('ep_post_sync_args', 'add_content_to_elastic', 10, 2); | |
function add_content_to_elastic($post_args, $post_id) |
This file contains 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 get_word_form( $count, $word_forms = [ 'предмет', 'предмета', 'предметов' ] ) { | |
$count = preg_replace( '/[^\d]/', '', $count ); | |
$n100 = $count % 100; | |
$n10 = $count % 10; | |
if ( ( $n100 > 10 ) && ( $n100 < 20 ) ) { | |
return $word_forms[2]; | |
} elseif ( $n10 == 1 ) { |