Last active
July 2, 2016 10:43
-
-
Save al5dy/201dcf85e1ee4260311aa682bacdd32c to your computer and use it in GitHub Desktop.
Получаем массив мета поля и удаляем значение под индексом "1" и далее выводим новый массив с обновленными ключами.
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
$list_of_values = get_post_meta($post->ID, $this->meta . 'custom_field', true ); | |
if (! empty ( $list_of_values )) { | |
unset($list_of_values[1]); | |
} | |
var_dump(array_combine(range(1, count($list_of_values)), array_values($list_of_values))); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment