aristath /
kirki
| 1 | <?php |
||
| 2 | /** |
||
| 3 | * Nested section. |
||
| 4 | * |
||
| 5 | * @package Kirki |
||
| 6 | * @subpackage Custom Sections Module |
||
| 7 | * @copyright Copyright (c) 2017, Aristeides Stathopoulos |
||
| 8 | * @license https://opensource.org/licenses/MIT |
||
| 9 | * @since 2.2.0 |
||
| 10 | */ |
||
| 11 | |||
| 12 | /** |
||
| 13 | * Nested section. |
||
| 14 | */ |
||
| 15 | class Kirki_Sections_Nested_Section extends WP_Customize_Section { |
||
| 16 | |||
| 17 | /** |
||
| 18 | * The parent section. |
||
| 19 | * |
||
| 20 | * @access public |
||
| 21 | * @since 3.0.0 |
||
| 22 | * @var string |
||
| 23 | */ |
||
| 24 | public $section; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * The section type. |
||
| 28 | * |
||
| 29 | * @access public |
||
| 30 | * @since 3.0.0 |
||
| 31 | * @var string |
||
| 32 | */ |
||
| 33 | public $type = 'kirki-nested'; |
||
| 34 | |||
| 35 | /** |
||
| 36 | * Gather the parameters passed to client JavaScript via JSON. |
||
| 37 | * |
||
| 38 | * @access public |
||
| 39 | * @since 3.0.0 |
||
| 40 | * @return array The array to be exported to the client as JSON. |
||
| 41 | */ |
||
| 42 | public function json() { |
||
| 43 | $array = wp_array_slice_assoc( |
||
| 44 | (array) $this, array( |
||
|
0 ignored issues
–
show
|
|||
| 45 | 'id', |
||
| 46 | 'description', |
||
| 47 | 'priority', |
||
| 48 | 'panel', |
||
| 49 | 'type', |
||
| 50 | 'description_hidden', |
||
| 51 | 'section', |
||
| 52 | ) |
||
| 53 | ); |
||
| 54 | |||
| 55 | $array['title'] = html_entity_decode( $this->title, ENT_QUOTES, get_bloginfo( 'charset' ) ); |
||
| 56 | $array['content'] = $this->get_content(); |
||
| 57 | $array['active'] = $this->active(); |
||
| 58 | $array['instanceNumber'] = $this->instance_number; |
||
| 59 | |||
| 60 | $array['customizeAction'] = esc_html__( 'Customizing', 'kirki' ); |
||
| 61 | if ( $this->panel ) { |
||
| 62 | /* translators: The title. */ |
||
| 63 | $array['customizeAction'] = sprintf( esc_html__( 'Customizing ▸ %s', 'kirki' ), esc_html( $this->manager->get_panel( $this->panel )->title ) ); |
||
| 64 | } |
||
| 65 | return $array; |
||
| 66 | } |
||
| 67 | } |
||
| 68 |
For a function calls that spawns multiple lines, the coding style suggests to split arguments to separate lines like this: