@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | /** |
58 | 58 | * Defines the field type slugs used for this field type. |
59 | 59 | */ |
60 | - public $aFieldTypeSlugs = array( 'media', ); |
|
60 | + public $aFieldTypeSlugs = array( 'media',); |
|
61 | 61 | |
62 | 62 | /** |
63 | 63 | * Defines the default key-values of this field type. |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | return |
92 | 92 | $this->_getScript_MediaUploader( |
93 | 93 | "admin_page_framework" |
94 | - ) . PHP_EOL |
|
94 | + ).PHP_EOL |
|
95 | 95 | . $this->_getScript_RegisterCallbacks(); |
96 | 96 | } |
97 | 97 | |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | $_sInsertFromURL = esc_js( $this->oMsg->get( 'insert_from_url' ) ); |
160 | 160 | |
161 | 161 | // If the WordPress version is 3.4.x or below |
162 | - if ( ! function_exists( 'wp_enqueue_media' ) ) { |
|
162 | + if ( !function_exists( 'wp_enqueue_media' ) ) { |
|
163 | 163 | return <<<JAVASCRIPTS |
164 | 164 | /** |
165 | 165 | * Bind/rebinds the thickbox script the given selector element. |
@@ -400,10 +400,10 @@ discard block |
||
400 | 400 | // Do not include the escaping character (backslash) in the heredoc variable declaration |
401 | 401 | // because the minifier script will parse it and the <<<JAVASCRIPTS and JAVASCRIPTS; parts are converted to double quotes (") |
402 | 402 | // which causes the PHP syntax error. |
403 | - $_sButtonHTML = '"' . $this->_getUploaderButtonHTML_Media( $sInputID, $aButtonAttributes, $bExternalSource ) . '"'; |
|
404 | - $_sRpeatable = $this->getAOrB( ! empty( $abRepeatable ), 'true', 'false' ); |
|
403 | + $_sButtonHTML = '"'.$this->_getUploaderButtonHTML_Media( $sInputID, $aButtonAttributes, $bExternalSource ).'"'; |
|
404 | + $_sRpeatable = $this->getAOrB( !empty( $abRepeatable ), 'true', 'false' ); |
|
405 | 405 | $_sExternalSource = $this->getAOrB( $bExternalSource, 'true', 'false' ); |
406 | - $_sScript = <<<JAVASCRIPTS |
|
406 | + $_sScript = <<<JAVASCRIPTS |
|
407 | 407 | if ( jQuery( 'a#select_media_{$sInputID}' ).length == 0 ) { |
408 | 408 | jQuery( 'input#{$sInputID}' ).after( $_sButtonHTML ); |
409 | 409 | } |
@@ -416,7 +416,7 @@ discard block |
||
416 | 416 | . '/* <![CDATA[ */' |
417 | 417 | . $_sScript |
418 | 418 | . '/* ]]> */' |
419 | - . "</script>". PHP_EOL; |
|
419 | + . "</script>".PHP_EOL; |
|
420 | 420 | |
421 | 421 | } |
422 | 422 | /** |
@@ -427,19 +427,19 @@ discard block |
||
427 | 427 | */ |
428 | 428 | private function _getUploaderButtonHTML_Media( $sInputID, array $aButtonAttributes, $bExternalSource ) { |
429 | 429 | |
430 | - $_bIsLabelSet = isset( $aButtonAttributes['data-label'] ) && $aButtonAttributes['data-label']; |
|
430 | + $_bIsLabelSet = isset( $aButtonAttributes[ 'data-label' ] ) && $aButtonAttributes[ 'data-label' ]; |
|
431 | 431 | $_aAttributes = $this->_getFormattedUploadButtonAttributes_Media( |
432 | 432 | $sInputID, |
433 | 433 | $aButtonAttributes, |
434 | 434 | $_bIsLabelSet, |
435 | 435 | $bExternalSource |
436 | 436 | ); |
437 | - return "<a " . $this->getAttributes( $_aAttributes ) . ">" |
|
437 | + return "<a ".$this->getAttributes( $_aAttributes ).">" |
|
438 | 438 | . $this->getAOrB( |
439 | 439 | $_bIsLabelSet, |
440 | - $_aAttributes['data-label'], |
|
440 | + $_aAttributes[ 'data-label' ], |
|
441 | 441 | $this->getAOrB( |
442 | - strrpos( $_aAttributes['class'], 'dashicons' ), |
|
442 | + strrpos( $_aAttributes[ 'class' ], 'dashicons' ), |
|
443 | 443 | '', |
444 | 444 | $this->oMsg->get( 'select_file' ) |
445 | 445 | ) |
@@ -455,26 +455,26 @@ discard block |
||
455 | 455 | */ |
456 | 456 | private function _getFormattedUploadButtonAttributes_Media( $sInputID, array $aButtonAttributes, $_bIsLabelSet, $bExternalSource ) { |
457 | 457 | |
458 | - $_aAttributes = array( |
|
458 | + $_aAttributes = array( |
|
459 | 459 | 'id' => "select_media_{$sInputID}", |
460 | 460 | 'href' => '#', |
461 | - 'data-uploader_type' => ( string ) function_exists( 'wp_enqueue_media' ), // ? 1 : 0, |
|
462 | - 'data-enable_external_source' => ( string ) ( bool ) $bExternalSource, // ? 1 : 0, |
|
461 | + 'data-uploader_type' => ( string ) function_exists( 'wp_enqueue_media' ), // ? 1 : 0, |
|
462 | + 'data-enable_external_source' => ( string ) ( bool ) $bExternalSource, // ? 1 : 0, |
|
463 | 463 | ) |
464 | 464 | + $aButtonAttributes |
465 | 465 | + array( |
466 | 466 | 'title' => $_bIsLabelSet |
467 | - ? $aButtonAttributes['data-label'] |
|
467 | + ? $aButtonAttributes[ 'data-label' ] |
|
468 | 468 | : $this->oMsg->get( 'select_file' ), |
469 | 469 | 'data-label' => null, |
470 | 470 | ); |
471 | - $_aAttributes['class'] = $this->getClassAttribute( |
|
471 | + $_aAttributes[ 'class' ] = $this->getClassAttribute( |
|
472 | 472 | 'select_media button button-small ', |
473 | 473 | $this->getAOrB( |
474 | - trim( $aButtonAttributes['class'] ), |
|
475 | - $aButtonAttributes['class'], |
|
474 | + trim( $aButtonAttributes[ 'class' ] ), |
|
475 | + $aButtonAttributes[ 'class' ], |
|
476 | 476 | $this->getAOrB( |
477 | - ! $_bIsLabelSet && version_compare( $GLOBALS['wp_version'], '3.8', '>=' ), |
|
477 | + !$_bIsLabelSet && version_compare( $GLOBALS[ 'wp_version' ], '3.8', '>=' ), |
|
478 | 478 | 'dashicons dashicons-portfolio', |
479 | 479 | '' |
480 | 480 | ) |
@@ -66,16 +66,16 @@ discard block |
||
66 | 66 | */ |
67 | 67 | protected function getField( $aField ) { |
68 | 68 | |
69 | - $_oCallerForm = $aField[ '_caller_object' ]; |
|
69 | + $_oCallerForm = $aField[ '_caller_object' ]; |
|
70 | 70 | |
71 | 71 | $_aInlineMixedOutput = array(); |
72 | - foreach( $this->getAsArray( $aField[ 'content' ] ) as $_aChildFieldset ) { |
|
72 | + foreach ( $this->getAsArray( $aField[ 'content' ] ) as $_aChildFieldset ) { |
|
73 | 73 | |
74 | 74 | if ( is_scalar( $_aChildFieldset ) ) { |
75 | 75 | continue; |
76 | 76 | } |
77 | 77 | |
78 | - if ( ! $this->isNormalPlacement( $_aChildFieldset ) ) { |
|
78 | + if ( !$this->isNormalPlacement( $_aChildFieldset ) ) { |
|
79 | 79 | continue; |
80 | 80 | } |
81 | 81 | |
@@ -91,12 +91,12 @@ discard block |
||
91 | 91 | $_oFieldset = new AdminPageFramework_Form_View___Fieldset( |
92 | 92 | $_aChildFieldset, |
93 | 93 | $_oCallerForm->aSavedData, |
94 | - $_oCallerForm->getFieldErrors(), // @todo Generate field errors. $this->aErrors, |
|
94 | + $_oCallerForm->getFieldErrors(), // @todo Generate field errors. $this->aErrors, |
|
95 | 95 | $_oCallerForm->aFieldTypeDefinitions, |
96 | 96 | $_oCallerForm->oMsg, |
97 | 97 | $_oCallerForm->aCallbacks // field output element callables. |
98 | 98 | ); |
99 | - $_aInlineMixedOutput[] = $_oFieldset->get(); // field output |
|
99 | + $_aInlineMixedOutput[ ] = $_oFieldset->get(); // field output |
|
100 | 100 | |
101 | 101 | |
102 | 102 | } |
@@ -66,7 +66,7 @@ |
||
66 | 66 | . ( $aField[ 'label' ] |
67 | 67 | ? "<span " . $this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ) . ">" |
68 | 68 | . $aField[ 'label' ] |
69 | - . "</span>" |
|
69 | + . "</span>" |
|
70 | 70 | : "" |
71 | 71 | ) |
72 | 72 | . "<input " . $this->getAttributes( $aField[ 'attributes' ] ) . " />" |
@@ -59,21 +59,21 @@ |
||
59 | 59 | protected function getField( $aField ) { |
60 | 60 | |
61 | 61 | return |
62 | - $aField['before_label'] |
|
62 | + $aField[ 'before_label' ] |
|
63 | 63 | . "<div class='admin-page-framework-input-label-container'>" |
64 | 64 | . "<label for='{$aField[ 'input_id' ]}'>" |
65 | 65 | . $aField[ 'before_input' ] |
66 | 66 | . ( $aField[ 'label' ] |
67 | - ? "<span " . $this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ) . ">" |
|
67 | + ? "<span ".$this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ).">" |
|
68 | 68 | . $aField[ 'label' ] |
69 | 69 | . "</span>" |
70 | 70 | : "" |
71 | 71 | ) |
72 | - . "<input " . $this->getAttributes( $aField[ 'attributes' ] ) . " />" |
|
73 | - . $aField['after_input'] |
|
72 | + . "<input ".$this->getAttributes( $aField[ 'attributes' ] )." />" |
|
73 | + . $aField[ 'after_input' ] |
|
74 | 74 | . "</label>" |
75 | 75 | . "</div>" |
76 | - . $aField['after_label']; |
|
76 | + . $aField[ 'after_label' ]; |
|
77 | 77 | |
78 | 78 | } |
79 | 79 |
@@ -43,7 +43,7 @@ |
||
43 | 43 | call_user_func_array( |
44 | 44 | $aFieldTypeDefinition[ 'hfFieldSetTypeSetter' ], |
45 | 45 | array( $sStructureType ) |
46 | - ); |
|
46 | + ); |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | if ( is_callable( $aFieldTypeDefinition[ 'hfFieldLoader' ] ) ) { |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | */ |
17 | 17 | class AdminPageFramework_Form_Model___DefaultValues extends AdminPageFramework_Form_Base { |
18 | 18 | |
19 | - public $aFieldsets = array(); |
|
19 | + public $aFieldsets = array(); |
|
20 | 20 | |
21 | 21 | /** |
22 | 22 | * Sets up hooks. |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | $_aParameters = func_get_args() + array( |
28 | 28 | $this->aFieldsets, |
29 | 29 | ); |
30 | - $this->aFieldsets = $_aParameters[ 0 ]; |
|
30 | + $this->aFieldsets = $_aParameters[ 0 ]; |
|
31 | 31 | |
32 | 32 | } |
33 | 33 | |
@@ -85,13 +85,13 @@ discard block |
||
85 | 85 | */ |
86 | 86 | private function _getDefaultValues( $aFieldsets, $aDefaultOptions ) { |
87 | 87 | |
88 | - foreach( $aFieldsets as $_sSectionPath => $_aItems ) { |
|
88 | + foreach ( $aFieldsets as $_sSectionPath => $_aItems ) { |
|
89 | 89 | |
90 | 90 | $_aSectionPath = explode( '|', $_sSectionPath ); |
91 | - foreach( $_aItems as $_sFieldPath => $_aFieldset ) { |
|
91 | + foreach ( $_aItems as $_sFieldPath => $_aFieldset ) { |
|
92 | 92 | $_aFieldPath = explode( '|', $_sFieldPath ); |
93 | 93 | $this->setMultiDimensionalArray( |
94 | - $aDefaultOptions, // by reference |
|
94 | + $aDefaultOptions, // by reference |
|
95 | 95 | '_default' === $_sSectionPath |
96 | 96 | ? array( $_sFieldPath ) |
97 | 97 | : array_merge( $_aSectionPath, $_aFieldPath ), // key address |
@@ -121,11 +121,11 @@ discard block |
||
121 | 121 | // If there are no sub-fields |
122 | 122 | if ( count( $_aSubFields ) == 0 ) { |
123 | 123 | return $this->getElement( |
124 | - $aFieldset, // subject |
|
125 | - 'value', // key |
|
124 | + $aFieldset, // subject |
|
125 | + 'value', // key |
|
126 | 126 | $this->getElement( // default value |
127 | - $aFieldset, // subject |
|
128 | - 'default', // key |
|
127 | + $aFieldset, // subject |
|
128 | + 'default', // key |
|
129 | 129 | null // default value |
130 | 130 | ) |
131 | 131 | ); |
@@ -134,13 +134,13 @@ discard block |
||
134 | 134 | // Otherwise, there are sub-fields |
135 | 135 | $_aDefault = array(); |
136 | 136 | array_unshift( $_aSubFields, $aFieldset ); // insert the main field into the very first index. |
137 | - foreach( $_aSubFields as $_iIndex => $_aField ) { |
|
137 | + foreach ( $_aSubFields as $_iIndex => $_aField ) { |
|
138 | 138 | $_aDefault[ $_iIndex ] = $this->getElement( |
139 | - $_aField, // subject |
|
140 | - 'value', // key |
|
139 | + $_aField, // subject |
|
140 | + 'value', // key |
|
141 | 141 | $this->getElement( // default value |
142 | - $_aField, // subject |
|
143 | - 'default', // key |
|
142 | + $_aField, // subject |
|
143 | + 'default', // key |
|
144 | 144 | null // default value |
145 | 145 | ) |
146 | 146 | ); |
@@ -63,9 +63,9 @@ discard block |
||
63 | 63 | } |
64 | 64 | |
65 | 65 | $_aSectionsets = $this->_getSectionsetsFormatted( |
66 | - array(), // section-sets array to modify - new formatted items will be stored here |
|
67 | - $this->aSectionsets, // parsing section-sets |
|
68 | - array(), // section path - empty for root |
|
66 | + array(), // section-sets array to modify - new formatted items will be stored here |
|
67 | + $this->aSectionsets, // parsing section-sets |
|
68 | + array(), // section path - empty for root |
|
69 | 69 | $this->sCapability // capability |
70 | 70 | ); |
71 | 71 | |
@@ -82,10 +82,10 @@ discard block |
||
82 | 82 | */ |
83 | 83 | private function _getSectionsetsFormatted( $_aNewSectionsets, $aSectionsetsToParse, $aSectionPath, $sCapability ) { |
84 | 84 | |
85 | - foreach( $aSectionsetsToParse as $_sSectionPath => $_aSectionset ) { |
|
85 | + foreach ( $aSectionsetsToParse as $_sSectionPath => $_aSectionset ) { |
|
86 | 86 | |
87 | 87 | // The '_default' section can be empty so do not check `if ( empty( $_aSectionset ) )` here. |
88 | - if ( ! is_array( $_aSectionset ) ) { |
|
88 | + if ( !is_array( $_aSectionset ) ) { |
|
89 | 89 | continue; |
90 | 90 | } |
91 | 91 | |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | |
117 | 117 | // 3.7.0+ For nested sections |
118 | 118 | $_aNewSectionsets = $this->_getNestedSections( |
119 | - $_aNewSectionsets, // sectionset array to modify |
|
119 | + $_aNewSectionsets, // sectionset array to modify |
|
120 | 120 | $_aSectionset, |
121 | 121 | $_aSectionPath, // section path |
122 | 122 | $_aSectionset[ 'capability' ] |
@@ -133,15 +133,15 @@ discard block |
||
133 | 133 | */ |
134 | 134 | private function _getNestedSections( $aSectionsetsToEdit, $aSectionset, $aSectionPath, $sCapability ) { |
135 | 135 | |
136 | - if ( ! $this->_hasNestedSections( $aSectionset ) ) { |
|
136 | + if ( !$this->_hasNestedSections( $aSectionset ) ) { |
|
137 | 137 | return $aSectionsetsToEdit; |
138 | 138 | } |
139 | 139 | |
140 | 140 | // Recursive call |
141 | 141 | return $this->_getSectionsetsFormatted( |
142 | - $aSectionsetsToEdit, // section-sets array to modify - new formatted items will be stored here |
|
143 | - $aSectionset[ 'content' ], // parsing section-sets |
|
144 | - $aSectionPath, // section path - empty for root |
|
142 | + $aSectionsetsToEdit, // section-sets array to modify - new formatted items will be stored here |
|
143 | + $aSectionset[ 'content' ], // parsing section-sets |
|
144 | + $aSectionPath, // section path - empty for root |
|
145 | 145 | $sCapability // capability |
146 | 146 | ); |
147 | 147 | |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | private function _hasNestedSections( $aSectionset ) { |
155 | 155 | |
156 | 156 | $aSectionset = $aSectionset + array( 'content' => null ); |
157 | - if ( ! is_array( $aSectionset[ 'content' ] ) ) { |
|
157 | + if ( !is_array( $aSectionset[ 'content' ] ) ) { |
|
158 | 158 | return false; |
159 | 159 | } |
160 | 160 | $_aContents = $aSectionset[ 'content' ]; |
@@ -28,38 +28,38 @@ discard block |
||
28 | 28 | static public $aStructure = array( |
29 | 29 | |
30 | 30 | // Required Keys |
31 | - 'field_id' => null, // (string) |
|
32 | - 'section_id' => null, // (string) |
|
31 | + 'field_id' => null, // (string) |
|
32 | + 'section_id' => null, // (string) |
|
33 | 33 | |
34 | 34 | // Optional Keys |
35 | - 'type' => null, // (string) (3.8.0+ Became okay to omit.) |
|
36 | - 'section_title' => null, // This will be assigned automatically in the formatting method. |
|
37 | - 'page_slug' => null, // This will be assigned automatically in the formatting method. |
|
38 | - 'tab_slug' => null, // This will be assigned automatically in the formatting method. |
|
39 | - 'option_key' => null, // This will be assigned automatically in the formatting method. |
|
40 | - 'class_name' => null, // Stores the instantiated class name. Used by the export field type. Also a third party custom field type uses it. |
|
35 | + 'type' => null, // (string) (3.8.0+ Became okay to omit.) |
|
36 | + 'section_title' => null, // This will be assigned automatically in the formatting method. |
|
37 | + 'page_slug' => null, // This will be assigned automatically in the formatting method. |
|
38 | + 'tab_slug' => null, // This will be assigned automatically in the formatting method. |
|
39 | + 'option_key' => null, // This will be assigned automatically in the formatting method. |
|
40 | + 'class_name' => null, // Stores the instantiated class name. Used by the export field type. Also a third party custom field type uses it. |
|
41 | 41 | 'capability' => null, |
42 | 42 | 'title' => null, |
43 | 43 | 'tip' => null, |
44 | 44 | 'description' => null, |
45 | - 'error_message' => null, // error message for the field |
|
45 | + 'error_message' => null, // error message for the field |
|
46 | 46 | 'before_label' => null, |
47 | 47 | 'after_label' => null, |
48 | 48 | 'if' => true, |
49 | - 'order' => null, // do not set the default number here for this key. |
|
49 | + 'order' => null, // do not set the default number here for this key. |
|
50 | 50 | 'default' => null, |
51 | 51 | 'value' => null, |
52 | - 'help' => null, // 2.1.0 |
|
53 | - 'help_aside' => null, // 2.1.0 |
|
54 | - 'repeatable' => null, // 2.1.3 |
|
55 | - 'sortable' => null, // 2.1.3 |
|
56 | - 'show_title_column' => true, // 3.0.0 |
|
57 | - 'hidden' => null, // 3.0.0 |
|
52 | + 'help' => null, // 2.1.0 |
|
53 | + 'help_aside' => null, // 2.1.0 |
|
54 | + 'repeatable' => null, // 2.1.3 |
|
55 | + 'sortable' => null, // 2.1.3 |
|
56 | + 'show_title_column' => true, // 3.0.0 |
|
57 | + 'hidden' => null, // 3.0.0 |
|
58 | 58 | |
59 | - 'placement' => 'normal', // 3.8.0 (string) accepts either 'section_title', 'field_title', or 'normal' |
|
59 | + 'placement' => 'normal', // 3.8.0 (string) accepts either 'section_title', 'field_title', or 'normal' |
|
60 | 60 | |
61 | 61 | // @todo Examine why an array is not set but null here for the attributes argument. |
62 | - 'attributes' => null, // 3.0.0 - the array represents the attributes of input tag |
|
62 | + 'attributes' => null, // 3.0.0 - the array represents the attributes of input tag |
|
63 | 63 | 'class' => array( // 3.3.1 |
64 | 64 | 'fieldrow' => array(), |
65 | 65 | 'fieldset' => array(), |
@@ -67,29 +67,29 @@ discard block |
||
67 | 67 | 'field' => array(), |
68 | 68 | ), |
69 | 69 | |
70 | - 'save' => true, // 3.6.0 |
|
71 | - 'content' => null, // 3.6.1 - (string) An overriding field-set output. |
|
70 | + 'save' => true, // 3.6.0 |
|
71 | + 'content' => null, // 3.6.1 - (string) An overriding field-set output. |
|
72 | 72 | |
73 | - 'show_debug_info' => null, // 3.8.8+ (boolean) whether to show debug information such as field definition tool-tips. This value is inherited from the section definition argument of the same name. Not setting a value here as it is determined with another calculated value. |
|
73 | + 'show_debug_info' => null, // 3.8.8+ (boolean) whether to show debug information such as field definition tool-tips. This value is inherited from the section definition argument of the same name. Not setting a value here as it is determined with another calculated value. |
|
74 | 74 | |
75 | 75 | // Internal Keys |
76 | - '_fields_type' => null, // @deprecated 3.7.0, 3.0.0 - an internal key that indicates the fields type such as page, meta box for pages, meta box for posts, or taxonomy. |
|
77 | - '_structure_type' => null, // 3.7.0 |
|
78 | - '_caller_object' => null, // 3.4.0 (object) stores the object of the caller class. The object is referenced when creating nested fields. |
|
79 | - |
|
80 | - '_section_path' => '', // 3.7.0 (string) Stores the section path that indicates the structural address of the nested section. e.g. my_section|nested_one |
|
81 | - '_section_path_array' => '', // 3.7.0 (array) An array version of the above section path. |
|
82 | - '_nested_depth' => 0, // 3.4.0 (integer) stores the level of the nesting depth. This is mostly used for debugging by checking if the field is a nested field or not. |
|
83 | - '_subsection_index' => null, // 3.7.0 Passed to the `field_definition_{...}` filter hook callbacks. |
|
84 | - '_section_repeatable' => false, // @deprecated |
|
85 | - '_is_section_repeatable' => false, // 3.8.0 (boolean) Whether the belonging section is repeatable or not. |
|
86 | - |
|
87 | - '_field_path' => '', // 3.7.0 (string) Stores the field path that indicates the structural location of the field. This is relative to the belonging section. |
|
76 | + '_fields_type' => null, // @deprecated 3.7.0, 3.0.0 - an internal key that indicates the fields type such as page, meta box for pages, meta box for posts, or taxonomy. |
|
77 | + '_structure_type' => null, // 3.7.0 |
|
78 | + '_caller_object' => null, // 3.4.0 (object) stores the object of the caller class. The object is referenced when creating nested fields. |
|
79 | + |
|
80 | + '_section_path' => '', // 3.7.0 (string) Stores the section path that indicates the structural address of the nested section. e.g. my_section|nested_one |
|
81 | + '_section_path_array' => '', // 3.7.0 (array) An array version of the above section path. |
|
82 | + '_nested_depth' => 0, // 3.4.0 (integer) stores the level of the nesting depth. This is mostly used for debugging by checking if the field is a nested field or not. |
|
83 | + '_subsection_index' => null, // 3.7.0 Passed to the `field_definition_{...}` filter hook callbacks. |
|
84 | + '_section_repeatable' => false, // @deprecated |
|
85 | + '_is_section_repeatable' => false, // 3.8.0 (boolean) Whether the belonging section is repeatable or not. |
|
86 | + |
|
87 | + '_field_path' => '', // 3.7.0 (string) Stores the field path that indicates the structural location of the field. This is relative to the belonging section. |
|
88 | 88 | '_field_path_array' => array(), // 3.7.0 (array) An array version of the above field path. |
89 | - '_parent_field_path' => '', // 3.8.0 (string) |
|
89 | + '_parent_field_path' => '', // 3.8.0 (string) |
|
90 | 90 | '_parent_field_path_array' => array(), // 3.8.0 (array) |
91 | 91 | |
92 | - '_is_title_embedded' => false, // 3.8.0 (boolean) whether the field title is in the fieldset element, not in the table th element. This becomes `true` for `section_title` fields and fields with the `placement` argument with the value of `section_title` or `field_title`. |
|
92 | + '_is_title_embedded' => false, // 3.8.0 (boolean) whether the field title is in the fieldset element, not in the table th element. This becomes `true` for `section_title` fields and fields with the `placement` argument with the value of `section_title` or `field_title`. |
|
93 | 93 | |
94 | 94 | ); |
95 | 95 | |
@@ -166,14 +166,14 @@ discard block |
||
166 | 166 | array( |
167 | 167 | '_fields_type' => $this->sStructureType, // @deprecated 3.7.0 backward-compatibility |
168 | 168 | '_structure_type' => $this->sStructureType, |
169 | - '_caller_object' => $this->oCallerObject, // 3.4.1+ Stores the caller form object. |
|
170 | - '_subsection_index' => $this->iSubSectionIndex, // 3.7.0+ |
|
169 | + '_caller_object' => $this->oCallerObject, // 3.4.1+ Stores the caller form object. |
|
170 | + '_subsection_index' => $this->iSubSectionIndex, // 3.7.0+ |
|
171 | 171 | ) |
172 | 172 | + $this->aFieldset, |
173 | 173 | array( |
174 | 174 | 'capability' => $this->sCapability, |
175 | 175 | 'section_id' => '_default', |
176 | - '_section_repeatable' => $this->bIsSectionRepeatable, // @deprecated 3.8.0 This was not used. |
|
176 | + '_section_repeatable' => $this->bIsSectionRepeatable, // @deprecated 3.8.0 This was not used. |
|
177 | 177 | '_is_section_repeatable' => $this->bIsSectionRepeatable, |
178 | 178 | ) |
179 | 179 | + self::$aStructure |
@@ -294,12 +294,12 @@ discard block |
||
294 | 294 | |
295 | 295 | ); |
296 | 296 | |
297 | - foreach( $aNestedFieldsets as $_isIndex => &$_aNestedFieldset ) { |
|
297 | + foreach ( $aNestedFieldsets as $_isIndex => &$_aNestedFieldset ) { |
|
298 | 298 | |
299 | 299 | // The inline-mixed type has a string element. |
300 | 300 | if ( is_scalar( $_aNestedFieldset ) ) { |
301 | 301 | $_aNestedFieldset = array( |
302 | - 'field_id' => $aParentFieldset[ 'field_id' ] . '_' . uniqid(), |
|
302 | + 'field_id' => $aParentFieldset[ 'field_id' ].'_'.uniqid(), |
|
303 | 303 | 'content' => $_aNestedFieldset, |
304 | 304 | ); |
305 | 305 | } |
@@ -34,47 +34,47 @@ discard block |
||
34 | 34 | // Optional |
35 | 35 | 'page_slug' => null, |
36 | 36 | 'tab_slug' => null, |
37 | - 'section_tab_slug' => null, // 3.0.0+ |
|
37 | + 'section_tab_slug' => null, // 3.0.0+ |
|
38 | 38 | 'title' => null, |
39 | 39 | 'description' => null, |
40 | 40 | 'capability' => null, |
41 | 41 | 'if' => true, |
42 | - 'order' => null, // do not set the default number here because incremented numbers will be added when registering the sections. |
|
42 | + 'order' => null, // do not set the default number here because incremented numbers will be added when registering the sections. |
|
43 | 43 | 'help' => null, |
44 | 44 | 'help_aside' => null, |
45 | - 'repeatable' => false, // (boolean|array) 3.0.0+ |
|
46 | - 'sortable' => false, // (boolean|array) 3.6.0+ |
|
45 | + 'repeatable' => false, // (boolean|array) 3.0.0+ |
|
46 | + 'sortable' => false, // (boolean|array) 3.6.0+ |
|
47 | 47 | 'attributes' => array( // 3.3.1+ |
48 | - 'class' => null, // set null to avoid undefined index warnings. |
|
49 | - 'style' => null, // set null to avoid undefined index warnings. |
|
48 | + 'class' => null, // set null to avoid undefined index warnings. |
|
49 | + 'style' => null, // set null to avoid undefined index warnings. |
|
50 | 50 | 'tab' => array(), |
51 | 51 | ), |
52 | 52 | 'class' => array( // 3.3.1+ |
53 | 53 | 'tab' => array(), |
54 | 54 | ), |
55 | - 'hidden' => false, // 3.3.1+ |
|
56 | - 'collapsible' => false, // 3.4.0+ (boolean|array) For the array structure see the $aStructure_CollapsibleArguments property. |
|
57 | - 'save' => true, // 3.6.0+ |
|
55 | + 'hidden' => false, // 3.3.1+ |
|
56 | + 'collapsible' => false, // 3.4.0+ (boolean|array) For the array structure see the $aStructure_CollapsibleArguments property. |
|
57 | + 'save' => true, // 3.6.0+ |
|
58 | 58 | |
59 | - 'content' => null, // 3.6.1+ (string) An overriding section-set output. |
|
59 | + 'content' => null, // 3.6.1+ (string) An overriding section-set output. |
|
60 | 60 | |
61 | - 'tip' => null, // 3.7.0 (string) Tool tip HTML strings. |
|
61 | + 'tip' => null, // 3.7.0 (string) Tool tip HTML strings. |
|
62 | 62 | |
63 | 63 | // Internal |
64 | - '_fields_type' => null, // @deprecated 3.7.0+ Use the `_structure_type` instead. 3.0.0+ - same as the one of the field definition array. Used to insert debug info at the bottom of sections. |
|
65 | - '_structure_type' => null, // 3.7.0+ |
|
66 | - '_is_first_index' => false, // 3.4.0+ (boolean) indicates whether it is the first item of the sub-sections (for repeatable sections). |
|
67 | - '_is_last_index' => false, // 3.4.0+ (boolean) indicates whether it is the last item of the sub-sections (for repeatable sections). |
|
64 | + '_fields_type' => null, // @deprecated 3.7.0+ Use the `_structure_type` instead. 3.0.0+ - same as the one of the field definition array. Used to insert debug info at the bottom of sections. |
|
65 | + '_structure_type' => null, // 3.7.0+ |
|
66 | + '_is_first_index' => false, // 3.4.0+ (boolean) indicates whether it is the first item of the sub-sections (for repeatable sections). |
|
67 | + '_is_last_index' => false, // 3.4.0+ (boolean) indicates whether it is the last item of the sub-sections (for repeatable sections). |
|
68 | 68 | |
69 | - '_section_path' => '', // 3.7.0+ (string) e.g. my_section|nested_section |
|
70 | - '_section_path_array' => '', // 3.7.0+ (array) an array version of the above section_path argument. Numerically indexed. |
|
71 | - '_nested_depth' => 0, // 3.7.0+ (integer) the nested level of the section |
|
69 | + '_section_path' => '', // 3.7.0+ (string) e.g. my_section|nested_section |
|
70 | + '_section_path_array' => '', // 3.7.0+ (array) an array version of the above section_path argument. Numerically indexed. |
|
71 | + '_nested_depth' => 0, // 3.7.0+ (integer) the nested level of the section |
|
72 | 72 | |
73 | 73 | // 3.6.0+ - (object) the caller framework factory object. This allows the framework to access the factory property when rendering the section. |
74 | 74 | // 3.7.0+ It no longer stores a factory object but a form object. |
75 | 75 | '_caller_object' => null, |
76 | 76 | |
77 | - 'show_debug_info' => null, // 3.8.8+ (boolean) Whether to display debug information. Inherits the page/in-page-tab setting (actually the factory property value of `$bShowDebugInfo` which gets updated by the page/tab setting). |
|
77 | + 'show_debug_info' => null, // 3.8.8+ (boolean) Whether to display debug information. Inherits the page/in-page-tab setting (actually the factory property value of `$bShowDebugInfo` which gets updated by the page/tab setting). |
|
78 | 78 | |
79 | 79 | ); |
80 | 80 | |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | |
94 | 94 | public $oCaller = null; |
95 | 95 | |
96 | - public $bShowDebugInfo = true; // 3.8.8+ |
|
96 | + public $bShowDebugInfo = true; // 3.8.8+ |
|
97 | 97 | |
98 | 98 | /** |
99 | 99 | * Sets up properties. |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | $this->sCapability, |
108 | 108 | $this->iCountOfElements, |
109 | 109 | $this->oCaller, |
110 | - $this->bShowDebugInfo, // 3.8.8+ |
|
110 | + $this->bShowDebugInfo, // 3.8.8+ |
|
111 | 111 | ); |
112 | 112 | $this->aSectionset = $_aParameters[ 0 ]; |
113 | 113 | $this->sSectionPath = $_aParameters[ 1 ]; |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | $this->sCapability = $_aParameters[ 3 ]; |
116 | 116 | $this->iCountOfElements = $_aParameters[ 4 ]; |
117 | 117 | $this->oCaller = $_aParameters[ 5 ]; |
118 | - $this->bShowDebugInfo = $_aParameters[ 6 ]; // 3.8.8+ |
|
118 | + $this->bShowDebugInfo = $_aParameters[ 6 ]; // 3.8.8+ |
|
119 | 119 | |
120 | 120 | } |
121 | 121 | |
@@ -130,16 +130,16 @@ discard block |
||
130 | 130 | $_aSectionPath = explode( '|', $this->sSectionPath ); |
131 | 131 | $_aSectionset = $this->uniteArrays( |
132 | 132 | array( |
133 | - '_fields_type' => $this->sStructureType, // @deprecated 3.7.0+ |
|
134 | - '_structure_type' => $this->sStructureType, // 3.7.0+ |
|
135 | - '_section_path' => $this->sSectionPath, // 3.7.0+ |
|
133 | + '_fields_type' => $this->sStructureType, // @deprecated 3.7.0+ |
|
134 | + '_structure_type' => $this->sStructureType, // 3.7.0+ |
|
135 | + '_section_path' => $this->sSectionPath, // 3.7.0+ |
|
136 | 136 | '_section_path_array' => $_aSectionPath, |
137 | - '_nested_depth' => count( $_aSectionPath ) - 1, // 3.7.0+ - zero base |
|
137 | + '_nested_depth' => count( $_aSectionPath ) - 1, // 3.7.0+ - zero base |
|
138 | 138 | ) |
139 | 139 | + $this->aSectionset |
140 | 140 | + array( |
141 | 141 | 'capability' => $this->sCapability, |
142 | - 'show_debug_info' => $this->bShowDebugInfo, // 3.8.8+ |
|
142 | + 'show_debug_info' => $this->bShowDebugInfo, // 3.8.8+ |
|
143 | 143 | ), |
144 | 144 | self::$aStructure |
145 | 145 | ); |
@@ -44,7 +44,7 @@ |
||
44 | 44 | $this->unsetDimensionalArrayElement( |
45 | 45 | $this->aSubject, |
46 | 46 | explode( '|', $_sFlatFieldAddress ) |
47 | - ); |
|
47 | + ); |
|
48 | 48 | } |
49 | 49 | return $this->aSubject; |
50 | 50 | } |
@@ -40,7 +40,7 @@ |
||
40 | 40 | * @return array The formatted definition array. |
41 | 41 | */ |
42 | 42 | public function get() { |
43 | - foreach( $this->aDimensionalKeys as $_sFlatFieldAddress ) { |
|
43 | + foreach ( $this->aDimensionalKeys as $_sFlatFieldAddress ) { |
|
44 | 44 | $this->unsetDimensionalArrayElement( |
45 | 45 | $this->aSubject, |
46 | 46 | explode( '|', $_sFlatFieldAddress ) |