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 | |
add_filter('fv/public/upload_form/label', 'custom_filter_public_upload_form_label', 1, 4); | |
function custom_filter_public_upload_form_label ($label, $field, $c, $contest) { | |
$lang = get_bloginfo( 'language' ); // 'ru-RU' - example | |
if ( trim($label) = "Titre de la vidéo" ) { | |
switch($lang) { | |
'be-BE': |
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 test_get_def_transal() { | |
// возвращаем массив, со значениями по умолчанию | |
return array( | |
'text_1' => 'This is text 1!', | |
'text_2' => 'This is text 2!', | |
); | |
} | |
function test_get_transal() { |
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 test_get_def_transal() { | |
// возвращаем массив, со значениями по умолчанию | |
return array( | |
'text_1' => 'This is text 1!', | |
'text_2' => 'This is text 2!', | |
); | |
} | |
function test_get_transal() { | |
// применяем фильтры и возвращаем значения Опции или значения по умолчанию |
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 --> | |
<!-- // Для начала подключим бибилиотку jQuery и jQuery cookie для сохранения города в Cookie --> | |
<script src="https://code.jquery.com/jquery-1.11.3.min.js"></script> | |
<script src="http://yandex.st/jquery/cookie/1.0/jquery.cookie.min.js"></script> | |
<?php | |
// Тперь получим ip посетителя и создадим переменую, | |
// что-бы скрипт мог ее использовать | |
if (isset($_SERVER['HTTP_X_REAL_IP'])) { | |
$ip = $_SERVER['HTTP_X_REAL_IP']; |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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 | |
//$photosModel = apply_filters( 'fv/public/pre_get_comp_items_list/model', $photosModel, $konurs_enabled, $AJAX_ACTION, $contest_id ); | |
add_filter( 'fv/public/pre_get_comp_items_list/model', 'fv_filter_home_photos_count', 10, 4 ); | |
function fv_filter_home_photos_count($photosModel, $konurs_enabled, $AJAX_ACTION, $contest_id) { | |
if (!$AJAX_ACTION && is_front_page()) { | |
// for change limit on other page replace "is_front_page()" to "is_page(22)" where "22" - page ID | |
$photosModel->limit( 5 ); |
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 custom_modify_get_avatar($args, $id_or_email) { | |
$avatar_att_id = get_user_meta( get_current_user_id(), '_avatar_att_id', true ); | |
if($avatar_att_id) { | |
$avatar_att_url = wp_get_attachment_image_src($avatar_att_id, array($args['width'], $args['height'])); | |
if ( !empty($avatar_att_url) ) { | |
$args['url'] = $avatar_att_url[0]; | |
} | |
} | |
return $args; |
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 fv_wp_head_og() { | |
echo '<!-- fv_wp_head_og -->'; | |
global $photo_obj; | |
// FIX for big images | |
$thumb_size = array( | |
'width' => 1400, | |
'height' => 1000, |
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
jQuery.cachedScript = function( url, options ) { | |
// Allow user to set any option except for dataType, cache, and url | |
options = $.extend( options || {}, { | |
dataType: "script", | |
cache: true, | |
url: url | |
}); | |
// Use $.ajax() since it is more flexible than $.getScript |
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 | |
// Hook includes/class-fv-functions.php :: render_template() | |
//apply_filters( 'fv_template_variables', $variables, $type, $template_path ); | |
add_filter( 'fv_template_variables', 'fv_change_descr_to_full_descr', 10, 2 ); | |
function fv_change_descr_to_full_descr($variables, $type) { | |
if ($type == 'theme') { | |
$variables['description'] = $variables['photo']->full_description; | |
} |
OlderNewer