php $字段Содержимоемассива

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php $字段Содержимоемассива相关的知识,希望对你有一定的参考价值。

<?php

add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' );
function custom_override_checkout_fields( $fields ) {
	unset($fields['billing']['billing_company']);
	unset($fields['billing']['billing_last_name']);
	unset($fields['billing']['billing_country']);
	unset($fields['billing']['billing_city']);
	unset($fields['billing']['billing_address_1']);
	unset($fields['billing']['billing_address_2']);
	unset($fields['billing']['billing_state']);
	unset($fields['billing']['billing_postcode']);

	$fields['billing']['billing_first_name']['label'] = 'Имя и фамилия';
	$fields['billing']['billing_first_name']['placeholder'] = 'Введите ФИО';
	$fields['billing']['billing_first_name']['class'][1] = 'row col-lg-6';
	$fields['billing']['billing_first_name']['label_class'][0] = 'col-12';
	$fields['billing']['billing_first_name']['input_class'][0] = 'col-12';

	$fields['billing']['billing_address_1']['class'][2] = 'row col-lg-6';
	$fields['billing']['billing_address_1']['label_class'][0] = 'col-12';
	$fields['billing']['billing_address_1']['input_class'][0] = 'col-12';
	$fields['billing']['billing_address_1']['label'] = 'Адрес доставки';
	//return $fields;
	print_r($fields);
}


<?php
Array (
  [billing] => Array (
    [billing_first_name] => Array (
      [label] => Имя и фамилия
      [required] => 1
      [class] => Array (
        [0] => form-row-first
        [1] => row col-lg-6
      )

      [autocomplete] => given-name
      [priority] => 10
      [placeholder] => Введите ФИО
      [label_class] => Array(
        [0] => col-12
      )

      [input_class] => Array(
        [0] => col-12
      )

    )

    [billing_address_1] => Array (
      [label] => Адрес доставки
      [placeholder] => Номер дома и название улицы
      [required] => 1
      [class] => Array(
        [0] => form-row-wide
        [1] => address-field
        [2] => row col-lg-6
      )

      [autocomplete] => address-line1
      [priority] => 50
      [label_class] => Array(
        [0] => col-12
      )

      [input_class] => Array(
        [0] => col-12
      )

    )

    [billing_phone] => Array (
      [label] => Телефон
      [required] => 1
      [type] => tel
      [class] => Array(
        [0] => form-row-wide
      )

      [validate] => Array(
        [0] => phone
      )

      [autocomplete] => tel
      [priority] => 100
    )

    [billing_email] => Array (
      [label] => Email
      [required] => 1
      [type] => email
      [class] => Array(
        [0] => form-row-wide
      )

      [validate] => Array (
        [0] => email
      )

      [autocomplete] => email username
      [priority] => 110
    )

  )

  [shipping] => Array (
    [shipping_first_name] => Array (
      [label] => Имя
      [required] => 1
      [class] => Array (
        [0] => form-row-first
      )

      [autocomplete] => given-name
      [priority] => 10
    )

    [shipping_last_name] => Array (
      [label] => Фамилия
      [required] => 1
      [class] => Array (
        [0] => form-row-last
      )

      [autocomplete] => family-name
      [priority] => 20
    )

    [shipping_country] => Array (
      [type] => country
      [label] => Страна
      [required] => 1
      [class] => Array (
        [0] => form-row-wide
        [1] => address-field
        [2] => update_totals_on_change
      )

      [autocomplete] => country
      [priority] => 40
    )

    [shipping_address_1] => Array (
      [label] => Адрес
      [placeholder] => Номер дома и название улицы
      [required] => 1
      [class] => Array(
        [0] => form-row-wide
        [1] => address-field
      )

      [autocomplete] => address-line1
      [priority] => 50
    )

    [shipping_city] => Array (
      [label] => Населённый пункт
      [required] => 1
      [class] => Array(
        [0] => form-row-wide
        [1] => address-field
      )

      [autocomplete] => address-level2
      [priority] => 70
    )

    [shipping_state] => Array (
      [type] => state
      [label] => Область/регион
      [required] => 1
      [class] => Array(
        [0] => form-row-wide
        [1] => address-field
      )

      [validate] => Array(
        [0] => state
      )

      [autocomplete] => address-level1
      [priority] => 80
      [country_field] => shipping_country
    )

    [shipping_postcode] => Array (
      [label] => Почтовый индекс
      [required] => 1
      [class] => Array(
        [0] => form-row-wide
        [1] => address-field
      )

      [validate] => Array(
        [0] => postcode
      )

      [autocomplete] => postal-code
      [priority] => 90
    )

  )

  [account] => Array(
    [account_password] => Array(
      [type] => password
      [label] => Создать пароль учетной записи
      [required] => 1
      [placeholder] => Пароль
    )

  )

  [order] => Array (
    [order_comments] => Array (
      [type] => textarea
      [class] => Array(
        [0] => notes
      )
      [label] => Примечание к заказу
      [placeholder] => Примечания к вашему заказу, например, особые пожелания отделу доставки.
    )
  )
)

以上是关于php $字段Содержимоемассива的主要内容,如果未能解决你的问题,请参考以下文章

python Костыльдляпереименованияатомоввpdbсежамивсоответствииснумерациейдимеров。

php Еслинамнужно,чтобыбылоневозможноредактироватьполе“Название”,мывносимследующеевычисление...

php phpеслипеременнаясодержитслово

Erlangе демо

php Вебсерверсклоненияпопадежамсловрусскихслов

php WordPress - Дружимвыводкороткойновостичерезget_the_excerptсзаписямисозданнымивKingComposer