Skip to content

Instantly share code, notes, and snippets.

@max-kk
Last active September 3, 2015 07:16
Show Gist options
  • Save max-kk/cb671974fe3a8fa4a452 to your computer and use it in GitHub Desktop.
Save max-kk/cb671974fe3a8fa4a452 to your computer and use it in GitHub Desktop.
<?php
function test_get_def_transal() {
// возвращаем массив, со значениями по умолчанию
return array(
'text_1' => 'This is text 1!',
'text_2' => 'This is text 2!',
);
}
function test_get_transal() {
// применяем фильтры и возвращаем значения Опции или значения по умолчанию
return apply_filters( 'test/traslations', get_option('test_trasnl', test_get_def_transl() ) );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment