@@ -219,24 +219,24 @@ discard block |
||
219 | 219 | } |
220 | 220 | |
221 | 221 | /** |
222 | - * Adds the given link(s) into the description cell of the plugin listing table. |
|
223 | - * |
|
224 | - * <h4>Example</h4> |
|
225 | - * <code>$this->addLinkToPluginDescription( |
|
226 | - * "<a href='http://www.google.com'>Google</a>", |
|
227 | - * "<a href='http://www.yahoo.com'>Yahoo!</a>" |
|
228 | - * );</code> |
|
229 | - * |
|
230 | - * @since 2.0.0 |
|
231 | - * @since 3.0.0 Changed the scope to public from protected. |
|
232 | - * @since 3.3.1 Moved from `AdminPageFramework`. |
|
233 | - * @remark Accepts variadic parameters; the number of accepted parameters are not limited to three. |
|
234 | - * @param string the tagged HTML link text. |
|
235 | - * @param string (optional) another tagged HTML link text. |
|
236 | - * @param string (optional) add more as many as want by adding items to the next parameters. |
|
237 | - * @access public |
|
238 | - * @return void |
|
239 | - */ |
|
222 | + * Adds the given link(s) into the description cell of the plugin listing table. |
|
223 | + * |
|
224 | + * <h4>Example</h4> |
|
225 | + * <code>$this->addLinkToPluginDescription( |
|
226 | + * "<a href='http://www.google.com'>Google</a>", |
|
227 | + * "<a href='http://www.yahoo.com'>Yahoo!</a>" |
|
228 | + * );</code> |
|
229 | + * |
|
230 | + * @since 2.0.0 |
|
231 | + * @since 3.0.0 Changed the scope to public from protected. |
|
232 | + * @since 3.3.1 Moved from `AdminPageFramework`. |
|
233 | + * @remark Accepts variadic parameters; the number of accepted parameters are not limited to three. |
|
234 | + * @param string the tagged HTML link text. |
|
235 | + * @param string (optional) another tagged HTML link text. |
|
236 | + * @param string (optional) add more as many as want by adding items to the next parameters. |
|
237 | + * @access public |
|
238 | + * @return void |
|
239 | + */ |
|
240 | 240 | public function addLinkToPluginDescription( $sTaggedLinkHTML1, $sTaggedLinkHTML2=null, $_and_more=null ) { |
241 | 241 | if ( method_exists( $this->oLink, '_addLinkToPluginDescription' ) ) { |
242 | 242 | $this->oLink->_addLinkToPluginDescription( func_get_args() ); |
@@ -244,23 +244,23 @@ discard block |
||
244 | 244 | } |
245 | 245 | |
246 | 246 | /** |
247 | - * Adds the given link(s) into the title cell of the plugin listing table. |
|
248 | - * |
|
249 | - * <h4>Example</h4> |
|
250 | - * <code>$this->addLinkToPluginTitle( |
|
251 | - * "<a href='http://www.wordpress.org'>WordPress</a>" |
|
252 | - * );</code> |
|
253 | - * |
|
254 | - * @since 2.0.0 |
|
255 | - * @since 3.0.0 Changed the scope to public from protected. |
|
256 | - * @since 3.3.1 Moved from `AdminPageFramework`. |
|
257 | - * @remark Accepts variadic parameters; the number of accepted parameters are not limited to three. |
|
258 | - * @param string the tagged HTML link text. |
|
259 | - * @param string (optional) another tagged HTML link text. |
|
260 | - * @param string (optional) add more as many as want by adding items to the next parameters. |
|
261 | - * @access public |
|
262 | - * @return void |
|
263 | - */ |
|
247 | + * Adds the given link(s) into the title cell of the plugin listing table. |
|
248 | + * |
|
249 | + * <h4>Example</h4> |
|
250 | + * <code>$this->addLinkToPluginTitle( |
|
251 | + * "<a href='http://www.wordpress.org'>WordPress</a>" |
|
252 | + * );</code> |
|
253 | + * |
|
254 | + * @since 2.0.0 |
|
255 | + * @since 3.0.0 Changed the scope to public from protected. |
|
256 | + * @since 3.3.1 Moved from `AdminPageFramework`. |
|
257 | + * @remark Accepts variadic parameters; the number of accepted parameters are not limited to three. |
|
258 | + * @param string the tagged HTML link text. |
|
259 | + * @param string (optional) another tagged HTML link text. |
|
260 | + * @param string (optional) add more as many as want by adding items to the next parameters. |
|
261 | + * @access public |
|
262 | + * @return void |
|
263 | + */ |
|
264 | 264 | public function addLinkToPluginTitle( $sTaggedLinkHTML1, $sTaggedLinkHTML2=null, $_and_more=null ) { |
265 | 265 | if ( method_exists( $this->oLink, '_addLinkToPluginTitle' ) ) { |
266 | 266 | $this->oLink->_addLinkToPluginTitle( func_get_args() ); |
@@ -140,24 +140,24 @@ discard block |
||
140 | 140 | } |
141 | 141 | |
142 | 142 | /** |
143 | - * Removes the given section(s) by section ID. |
|
144 | - * |
|
145 | - * This accesses the property storing the added section arrays and removes the specified ones. |
|
146 | - * |
|
147 | - * <h4>Example</h4> |
|
148 | - * <code>$this->removeSettingSections( 'text_fields', 'selectors', 'another_section', 'yet_another_section' ); |
|
149 | - * </code> |
|
150 | - * |
|
151 | - * @since 2.0.0 |
|
152 | - * @since 3.0.0 Changed the scope to public from protected. |
|
153 | - * @since 3.5.3 Removed the parameter declarations as they are caught with the func_get_args(). |
|
154 | - * @access public |
|
155 | - * @remark Accepts variadic parameters; the number of accepted parameters are not limited to three. |
|
156 | - * @param string $sSectionID1 the section ID to remove. |
|
157 | - * @param string $sSectionID2 (optional) another section ID to remove. |
|
158 | - * @param string $_and_more (optional) add more section IDs to the next parameters as many as necessary. |
|
159 | - * @return void |
|
160 | - */ |
|
143 | + * Removes the given section(s) by section ID. |
|
144 | + * |
|
145 | + * This accesses the property storing the added section arrays and removes the specified ones. |
|
146 | + * |
|
147 | + * <h4>Example</h4> |
|
148 | + * <code>$this->removeSettingSections( 'text_fields', 'selectors', 'another_section', 'yet_another_section' ); |
|
149 | + * </code> |
|
150 | + * |
|
151 | + * @since 2.0.0 |
|
152 | + * @since 3.0.0 Changed the scope to public from protected. |
|
153 | + * @since 3.5.3 Removed the parameter declarations as they are caught with the func_get_args(). |
|
154 | + * @access public |
|
155 | + * @remark Accepts variadic parameters; the number of accepted parameters are not limited to three. |
|
156 | + * @param string $sSectionID1 the section ID to remove. |
|
157 | + * @param string $sSectionID2 (optional) another section ID to remove. |
|
158 | + * @param string $_and_more (optional) add more section IDs to the next parameters as many as necessary. |
|
159 | + * @return void |
|
160 | + */ |
|
161 | 161 | public function removeSettingSections( /* $sSectionID1=null, $sSectionID2=null, $_and_more=null */ ) { |
162 | 162 | |
163 | 163 | foreach( func_get_args() as $_sSectionID ) { |
@@ -224,38 +224,38 @@ discard block |
||
224 | 224 | } |
225 | 225 | } |
226 | 226 | /** |
227 | - * Adds the given field array items into the field array property. |
|
228 | - * |
|
229 | - * Identical to the `addSettingFields()` method except that this method does not accept enumerated parameters. |
|
230 | - * |
|
231 | - * @since 2.1.2 |
|
232 | - * @since 3.0.0 Changed the scope to public from protected. |
|
233 | - * @access public |
|
234 | - * @param array|string $asField the field array or the target section ID. If the target section ID is set, the section_id key can be omitted from the next passing field array. |
|
235 | - * @return void |
|
236 | - */ |
|
227 | + * Adds the given field array items into the field array property. |
|
228 | + * |
|
229 | + * Identical to the `addSettingFields()` method except that this method does not accept enumerated parameters. |
|
230 | + * |
|
231 | + * @since 2.1.2 |
|
232 | + * @since 3.0.0 Changed the scope to public from protected. |
|
233 | + * @access public |
|
234 | + * @param array|string $asField the field array or the target section ID. If the target section ID is set, the section_id key can be omitted from the next passing field array. |
|
235 | + * @return void |
|
236 | + */ |
|
237 | 237 | public function addSettingField( $asField ) { |
238 | 238 | $this->oForm->addField( $asField ); |
239 | 239 | } |
240 | 240 | |
241 | 241 | /** |
242 | - * Removes the given field(s) by field ID. |
|
243 | - * |
|
244 | - * This accesses the property storing the added field arrays and removes the specified ones. |
|
245 | - * |
|
246 | - * <h4>Example</h4> |
|
247 | - * <code>$this->removeSettingFields( 'fieldID_A', 'fieldID_B', 'fieldID_C', 'fieldID_D' ); |
|
248 | - * </code> |
|
249 | - * |
|
250 | - * @since 2.0.0 |
|
251 | - * @since 3.0.0 Changed the scope to public from protected. |
|
252 | - * @access public |
|
253 | - * @remark Accepts variadic parameters; the number of accepted parameters are not limited to three. |
|
254 | - * @param string $sFieldID1 the field ID to remove. |
|
255 | - * @param string $sFieldID2 (optional) another field ID to remove. |
|
256 | - * @param string $_and_more (optional) add more field IDs to the next parameters as many as necessary. |
|
257 | - * @return void |
|
258 | - */ |
|
242 | + * Removes the given field(s) by field ID. |
|
243 | + * |
|
244 | + * This accesses the property storing the added field arrays and removes the specified ones. |
|
245 | + * |
|
246 | + * <h4>Example</h4> |
|
247 | + * <code>$this->removeSettingFields( 'fieldID_A', 'fieldID_B', 'fieldID_C', 'fieldID_D' ); |
|
248 | + * </code> |
|
249 | + * |
|
250 | + * @since 2.0.0 |
|
251 | + * @since 3.0.0 Changed the scope to public from protected. |
|
252 | + * @access public |
|
253 | + * @remark Accepts variadic parameters; the number of accepted parameters are not limited to three. |
|
254 | + * @param string $sFieldID1 the field ID to remove. |
|
255 | + * @param string $sFieldID2 (optional) another field ID to remove. |
|
256 | + * @param string $_and_more (optional) add more field IDs to the next parameters as many as necessary. |
|
257 | + * @return void |
|
258 | + */ |
|
259 | 259 | public function removeSettingFields( $sFieldID1, $sFieldID2=null, $_and_more ) { |
260 | 260 | foreach( func_get_args() as $_sFieldID ) { |
261 | 261 | $this->oForm->removeField( $_sFieldID ); |
@@ -104,39 +104,39 @@ discard block |
||
104 | 104 | } |
105 | 105 | |
106 | 106 | /** |
107 | - * Adds sub-menu items on the left sidebar menu of the administration panel. |
|
108 | - * |
|
109 | - * It supports pages and links. Each of them has the specific array structure. |
|
110 | - * |
|
111 | - * <h4>Example</h4> |
|
112 | - * <code>$this->addSubMenuItems( |
|
113 | - * array( |
|
114 | - * 'title' => 'Various Form Fields', |
|
115 | - * 'page_slug' => 'first_page', |
|
116 | - * 'screen_icon' => 'options-general', |
|
117 | - * ), |
|
118 | - * array( |
|
119 | - * 'title' => 'Manage Options', |
|
120 | - * 'page_slug' => 'second_page', |
|
121 | - * 'screen_icon' => 'link-manager', |
|
122 | - * ), |
|
123 | - * array( |
|
124 | - * 'title' => 'Google', |
|
125 | - * 'href' => 'http://www.google.com', |
|
126 | - * 'show_page_heading_tab' => false, // this removes the title from the page heading tabs. |
|
127 | - * ) |
|
128 | - * );</code> |
|
129 | - * |
|
130 | - * @since 2.0.0 |
|
131 | - * @since 3.0.0 Changed the scope to public. |
|
132 | - * @remark The sub menu page slug should be unique because add_submenu_page() can add one callback per page slug. |
|
133 | - * @remark Accepts variadic parameters; the number of accepted parameters are not limited to three. |
|
134 | - * @param array $aSubMenuItem1 a first sub-menu array. A sub-menu array can be a link or a page. For the specifications of the array structures and its arguments, refer to the parameter section of the `addSubMenuItem()` method. |
|
135 | - * @param array $aSubMenuItem2 (optional) a second sub-menu array. |
|
136 | - * @param array $_and_more (optional) a third and add items as many as necessary with next parameters. |
|
137 | - * @access public |
|
138 | - * @return void |
|
139 | - */ |
|
107 | + * Adds sub-menu items on the left sidebar menu of the administration panel. |
|
108 | + * |
|
109 | + * It supports pages and links. Each of them has the specific array structure. |
|
110 | + * |
|
111 | + * <h4>Example</h4> |
|
112 | + * <code>$this->addSubMenuItems( |
|
113 | + * array( |
|
114 | + * 'title' => 'Various Form Fields', |
|
115 | + * 'page_slug' => 'first_page', |
|
116 | + * 'screen_icon' => 'options-general', |
|
117 | + * ), |
|
118 | + * array( |
|
119 | + * 'title' => 'Manage Options', |
|
120 | + * 'page_slug' => 'second_page', |
|
121 | + * 'screen_icon' => 'link-manager', |
|
122 | + * ), |
|
123 | + * array( |
|
124 | + * 'title' => 'Google', |
|
125 | + * 'href' => 'http://www.google.com', |
|
126 | + * 'show_page_heading_tab' => false, // this removes the title from the page heading tabs. |
|
127 | + * ) |
|
128 | + * );</code> |
|
129 | + * |
|
130 | + * @since 2.0.0 |
|
131 | + * @since 3.0.0 Changed the scope to public. |
|
132 | + * @remark The sub menu page slug should be unique because add_submenu_page() can add one callback per page slug. |
|
133 | + * @remark Accepts variadic parameters; the number of accepted parameters are not limited to three. |
|
134 | + * @param array $aSubMenuItem1 a first sub-menu array. A sub-menu array can be a link or a page. For the specifications of the array structures and its arguments, refer to the parameter section of the `addSubMenuItem()` method. |
|
135 | + * @param array $aSubMenuItem2 (optional) a second sub-menu array. |
|
136 | + * @param array $_and_more (optional) a third and add items as many as necessary with next parameters. |
|
137 | + * @access public |
|
138 | + * @return void |
|
139 | + */ |
|
140 | 140 | public function addSubMenuItems( $aSubMenuItem1, $aSubMenuItem2=null, $_and_more=null ) { |
141 | 141 | foreach ( func_get_args() as $_aSubMenuItem ) { |
142 | 142 | $this->addSubMenuItem( $_aSubMenuItem ); |
@@ -144,50 +144,50 @@ discard block |
||
144 | 144 | } |
145 | 145 | |
146 | 146 | /** |
147 | - * Adds the given sub-menu item on the left sidebar menu of the administration panel. |
|
148 | - * |
|
149 | - * It supports pages and links. Each of them has the specific array structure. |
|
150 | - * |
|
151 | - * <h4>Example</h4> |
|
152 | - * <code>$this->addSubMenuItem( |
|
153 | - * array( |
|
154 | - * 'title' => 'Read Me', |
|
155 | - * 'menu_title' => 'About' |
|
156 | - * 'page_slug' => 'my_plugin_readme', |
|
157 | - * ) |
|
158 | - * );</code> |
|
159 | - * |
|
160 | - * @since 2.0.0 |
|
161 | - * @since 3.0.0 Changed the scope to public. |
|
162 | - * @remark The sub menu page slug should be unique because add_submenu_page() can add one callback per page slug. |
|
163 | - * @param array a sub-menu array. It can be a page or a link. The array structures are as follows: |
|
164 | - * <h4>Sub-menu Page Array</h4> |
|
165 | - * <ul> |
|
166 | - * <li>**title** - (string) the page title of the page.</li> |
|
167 | - * <li>**page_slug** - (string) the page slug of the page. Non-alphabetical characters should not be used including dots(.) and hyphens(-).</li> |
|
168 | - * <li>**screen_icon** - (optional, string) either the ID selector name from the following list or the icon URL. The size of the icon should be 32 by 32 in pixel. This is for WordPress 3.7.x or below. |
|
169 | - * <pre>edit, post, index, media, upload, link-manager, link, link-category, edit-pages, page, edit-comments, themes, plugins, users, profile, user-edit, tools, admin, options-general, ms-admin, generic</pre> |
|
170 | - * <p>( Notes: the `generic` icon is available WordPress version 3.5 or above.)</p> |
|
171 | - * </li> |
|
172 | - * <li>**capability** - (optional, string) the access level to the created admin pages defined <a href="http://codex.wordpress.org/Roles_and_Capabilities">here</a>. If not set, the overall capability assigned in the class constructor, which is `manage_options` by default, will be used.</li> |
|
173 | - * <li>**order** - (optional, integer) the order number of the page. The lager the number is, the lower the position it is placed in the menu.</li> |
|
174 | - * <li>**show_page_heading_tab** - (optional, boolean) if this is set to false, the page title won't be displayed in the page heading tab. Default: `true`.</li> |
|
175 | - * <li>**show_in_menu** - (optional) If this is set to false, the page title won't be displayed in the sidebar menu while the page is still accessible. Default: true.</li> |
|
176 | - * <li>**page_title** - (optional) [3.3.0+] When the page title differs from the menu title, use this argument.</li> |
|
177 | - * <li>**menu_title** - (optional) [3.3.0+] When the menu title differs from the menu title, use this argument.</li> |
|
178 | - * </ul> |
|
179 | - * <h4>Sub-menu Link Array</h4> |
|
180 | - * <ul> |
|
181 | - * <li>**title** - (string) the link title.</li> |
|
182 | - * <li>**href** - (string) the URL of the target link.</li> |
|
183 | - * <li>**capability** - (optional, string) the access level to show the item, defined <a href="http://codex.wordpress.org/Roles_and_Capabilities">here</a>. If not set, the overall capability assigned in the class constructor, which is `manage_options` by default, will be used.</li> |
|
184 | - * <li>**order** - (optional, integer) the order number of the page. The lager the number is, the lower the position it is placed in the menu.</li> |
|
185 | - * <li>**show_page_heading_tab** - (optional, boolean) if this is set to false, the page title won't be displayed in the page heading tab. Default: `true`.</li> |
|
186 | - * <li>**show_in_menu** - (optional) If this is set to false, the page title won't be displayed in the sidebar menu while the page is still accessible. Default: true.</li> |
|
187 | - * </ul> |
|
188 | - * @access public |
|
189 | - * @return void |
|
190 | - */ |
|
147 | + * Adds the given sub-menu item on the left sidebar menu of the administration panel. |
|
148 | + * |
|
149 | + * It supports pages and links. Each of them has the specific array structure. |
|
150 | + * |
|
151 | + * <h4>Example</h4> |
|
152 | + * <code>$this->addSubMenuItem( |
|
153 | + * array( |
|
154 | + * 'title' => 'Read Me', |
|
155 | + * 'menu_title' => 'About' |
|
156 | + * 'page_slug' => 'my_plugin_readme', |
|
157 | + * ) |
|
158 | + * );</code> |
|
159 | + * |
|
160 | + * @since 2.0.0 |
|
161 | + * @since 3.0.0 Changed the scope to public. |
|
162 | + * @remark The sub menu page slug should be unique because add_submenu_page() can add one callback per page slug. |
|
163 | + * @param array a sub-menu array. It can be a page or a link. The array structures are as follows: |
|
164 | + * <h4>Sub-menu Page Array</h4> |
|
165 | + * <ul> |
|
166 | + * <li>**title** - (string) the page title of the page.</li> |
|
167 | + * <li>**page_slug** - (string) the page slug of the page. Non-alphabetical characters should not be used including dots(.) and hyphens(-).</li> |
|
168 | + * <li>**screen_icon** - (optional, string) either the ID selector name from the following list or the icon URL. The size of the icon should be 32 by 32 in pixel. This is for WordPress 3.7.x or below. |
|
169 | + * <pre>edit, post, index, media, upload, link-manager, link, link-category, edit-pages, page, edit-comments, themes, plugins, users, profile, user-edit, tools, admin, options-general, ms-admin, generic</pre> |
|
170 | + * <p>( Notes: the `generic` icon is available WordPress version 3.5 or above.)</p> |
|
171 | + * </li> |
|
172 | + * <li>**capability** - (optional, string) the access level to the created admin pages defined <a href="http://codex.wordpress.org/Roles_and_Capabilities">here</a>. If not set, the overall capability assigned in the class constructor, which is `manage_options` by default, will be used.</li> |
|
173 | + * <li>**order** - (optional, integer) the order number of the page. The lager the number is, the lower the position it is placed in the menu.</li> |
|
174 | + * <li>**show_page_heading_tab** - (optional, boolean) if this is set to false, the page title won't be displayed in the page heading tab. Default: `true`.</li> |
|
175 | + * <li>**show_in_menu** - (optional) If this is set to false, the page title won't be displayed in the sidebar menu while the page is still accessible. Default: true.</li> |
|
176 | + * <li>**page_title** - (optional) [3.3.0+] When the page title differs from the menu title, use this argument.</li> |
|
177 | + * <li>**menu_title** - (optional) [3.3.0+] When the menu title differs from the menu title, use this argument.</li> |
|
178 | + * </ul> |
|
179 | + * <h4>Sub-menu Link Array</h4> |
|
180 | + * <ul> |
|
181 | + * <li>**title** - (string) the link title.</li> |
|
182 | + * <li>**href** - (string) the URL of the target link.</li> |
|
183 | + * <li>**capability** - (optional, string) the access level to show the item, defined <a href="http://codex.wordpress.org/Roles_and_Capabilities">here</a>. If not set, the overall capability assigned in the class constructor, which is `manage_options` by default, will be used.</li> |
|
184 | + * <li>**order** - (optional, integer) the order number of the page. The lager the number is, the lower the position it is placed in the menu.</li> |
|
185 | + * <li>**show_page_heading_tab** - (optional, boolean) if this is set to false, the page title won't be displayed in the page heading tab. Default: `true`.</li> |
|
186 | + * <li>**show_in_menu** - (optional) If this is set to false, the page title won't be displayed in the sidebar menu while the page is still accessible. Default: true.</li> |
|
187 | + * </ul> |
|
188 | + * @access public |
|
189 | + * @return void |
|
190 | + */ |
|
191 | 191 | public function addSubMenuItem( array $aSubMenuItem ) { |
192 | 192 | if ( isset( $aSubMenuItem[ 'href' ] ) ) { |
193 | 193 | $this->addSubMenuLink( $aSubMenuItem ); |
@@ -197,20 +197,20 @@ discard block |
||
197 | 197 | } |
198 | 198 | |
199 | 199 | /** |
200 | - * Adds the given link into the menu on the left sidebar of the administration panel. |
|
201 | - * |
|
202 | - * @since 2.0.0 |
|
203 | - * @since 3.0.0 Changed the scope to public from protected. |
|
204 | - * @since 3.5.0 Changed the scope to public as it was still protected. |
|
205 | - * @param string the menu title. |
|
206 | - * @param string the URL linked to the menu. |
|
207 | - * @param string (optional) the <a href="http://codex.wordpress.org/Roles_and_Capabilities" target="_blank">access level</a>. |
|
208 | - * @param string (optional) the order number. The larger it is, the lower the position it gets. |
|
209 | - * @param string (optional) if set to false, the menu title will not be listed in the tab navigation menu at the top of the page. |
|
210 | - * @access public |
|
211 | - * @return void |
|
212 | - * @internal |
|
213 | - */ |
|
200 | + * Adds the given link into the menu on the left sidebar of the administration panel. |
|
201 | + * |
|
202 | + * @since 2.0.0 |
|
203 | + * @since 3.0.0 Changed the scope to public from protected. |
|
204 | + * @since 3.5.0 Changed the scope to public as it was still protected. |
|
205 | + * @param string the menu title. |
|
206 | + * @param string the URL linked to the menu. |
|
207 | + * @param string (optional) the <a href="http://codex.wordpress.org/Roles_and_Capabilities" target="_blank">access level</a>. |
|
208 | + * @param string (optional) the order number. The larger it is, the lower the position it gets. |
|
209 | + * @param string (optional) if set to false, the menu title will not be listed in the tab navigation menu at the top of the page. |
|
210 | + * @access public |
|
211 | + * @return void |
|
212 | + * @internal |
|
213 | + */ |
|
214 | 214 | public function addSubMenuLink( array $aSubMenuLink ) { |
215 | 215 | |
216 | 216 | // If required keys are not set, return. |
@@ -18,32 +18,32 @@ |
||
18 | 18 | abstract class AdminPageFramework_MetaBox_Controller extends AdminPageFramework_MetaBox_View { |
19 | 19 | |
20 | 20 | /** |
21 | - * The method for all necessary set-ups. |
|
22 | - * |
|
23 | - * <h4>Example</h4> |
|
24 | - * <code> public function setUp() { |
|
25 | - * $this->addSettingFields( |
|
26 | - * array( |
|
27 | - * 'field_id' => 'sample_metabox_text_field', |
|
28 | - * 'title' => 'Text Input', |
|
29 | - * 'description' => 'The description for the field.', |
|
30 | - * 'type' => 'text', |
|
31 | - * ), |
|
32 | - * array( |
|
33 | - * 'field_id' => 'sample_metabox_textarea_field', |
|
34 | - * 'title' => 'Textarea', |
|
35 | - * 'description' => 'The description for the field.', |
|
36 | - * 'type' => 'textarea', |
|
37 | - * 'default' => 'This is a default text value.', |
|
38 | - * ) |
|
39 | - * ); |
|
40 | - * }</code> |
|
41 | - * |
|
42 | - * @abstract |
|
43 | - * @since 2.0.0 |
|
44 | - * @remark The user should override this method. |
|
45 | - * @return void |
|
46 | - */ |
|
21 | + * The method for all necessary set-ups. |
|
22 | + * |
|
23 | + * <h4>Example</h4> |
|
24 | + * <code> public function setUp() { |
|
25 | + * $this->addSettingFields( |
|
26 | + * array( |
|
27 | + * 'field_id' => 'sample_metabox_text_field', |
|
28 | + * 'title' => 'Text Input', |
|
29 | + * 'description' => 'The description for the field.', |
|
30 | + * 'type' => 'text', |
|
31 | + * ), |
|
32 | + * array( |
|
33 | + * 'field_id' => 'sample_metabox_textarea_field', |
|
34 | + * 'title' => 'Textarea', |
|
35 | + * 'description' => 'The description for the field.', |
|
36 | + * 'type' => 'textarea', |
|
37 | + * 'default' => 'This is a default text value.', |
|
38 | + * ) |
|
39 | + * ); |
|
40 | + * }</code> |
|
41 | + * |
|
42 | + * @abstract |
|
43 | + * @since 2.0.0 |
|
44 | + * @remark The user should override this method. |
|
45 | + * @return void |
|
46 | + */ |
|
47 | 47 | public function setUp() {} |
48 | 48 | |
49 | 49 | /** |
@@ -136,11 +136,11 @@ |
||
136 | 136 | * |
137 | 137 | * Triggered when a post has not been created so no post id is assigned. |
138 | 138 | * |
139 | - * @internal |
|
139 | + * @internal |
|
140 | 140 | * @since 3.3.0 |
141 | 141 | * @callback filter wp_insert_attachment_data |
142 | 142 | * @callback filter wp_insert_post_data |
143 | - * @param array $aPostData An array of slashed post data. |
|
143 | + * @param array $aPostData An array of slashed post data. |
|
144 | 144 | * @param array $aUnmodified An array of sanitized, but otherwise unmodified post data. |
145 | 145 | */ |
146 | 146 | public function _replyToFilterSavingData( $aPostData, $aUnmodified ) { |
@@ -18,77 +18,75 @@ |
||
18 | 18 | abstract class AdminPageFramework_PostType extends AdminPageFramework_PostType_Controller { |
19 | 19 | |
20 | 20 | /** |
21 | - * The constructor of the class object. |
|
22 | - * |
|
23 | - * Registers necessary hooks and sets up internal properties. |
|
24 | - * |
|
25 | - * <h4>Example</h4> |
|
26 | - * <code>new APF_PostType( |
|
27 | - * 'apf_posts', // post type slug |
|
28 | - * array( |
|
29 | - * 'labels' => array( |
|
30 | - * 'name' => 'Demo', |
|
31 | - * 'all_items' => __( 'Sample Posts', 'admin-page-framework-demo' ), |
|
32 | - * 'singular_name' => 'Demo', |
|
33 | - * 'add_new' => __( 'Add New', 'admin-page-framework-demo' ), |
|
34 | - * 'add_new_item' => __( 'Add New APF Post', 'admin-page-framework-demo' ), |
|
35 | - * 'edit' => __( 'Edit', 'admin-page-framework-demo' ), |
|
36 | - * 'edit_item' => __( 'Edit APF Post', 'admin-page-framework-demo' ), |
|
37 | - * 'new_item' => __( 'New APF Post', 'admin-page-framework-demo' ), |
|
38 | - * 'view' => __( 'View', 'admin-page-framework-demo' ), |
|
39 | - * 'view_item' => __( 'View APF Post', 'admin-page-framework-demo' ), |
|
40 | - * 'search_items' => __( 'Search APF Post', 'admin-page-framework-demo' ), |
|
41 | - * 'not_found' => __( 'No APF Post found', 'admin-page-framework-demo' ), |
|
42 | - * 'not_found_in_trash' => __( 'No APF Post found in Trash', 'admin-page-framework-demo' ), |
|
43 | - * 'parent' => __( 'Parent APF Post', 'admin-page-framework-demo' ), |
|
44 | - * |
|
45 | - * // (framework specific) |
|
46 | - * 'plugin_listing_table_title_cell_link' => __( 'APF Posts', 'admin-page-framework-demo' ), // framework specific key. [3.0.6+] |
|
47 | - * ), |
|
48 | - * 'public' => true, |
|
49 | - * 'menu_position' => 110, |
|
50 | - * 'supports' => array( 'title' ), // e.g. array( 'title', 'editor', 'comments', 'thumbnail', 'excerpt' ), |
|
51 | - * 'taxonomies' => array( '' ), |
|
52 | - * 'has_archive' => true, |
|
53 | - * 'show_admin_column' => true, // [3.5+ core] this is for custom taxonomies to automatically add the column in the listing table. |
|
54 | - * 'menu_icon' => $this->oProp->bIsAdmin |
|
55 | - * ? ( |
|
56 | - * version_compare( $GLOBALS['wp_version'], '3.8', '>=' ) |
|
57 | - * ? 'dashicons-wordpress' |
|
58 | - * : plugins_url( 'asset/image/wp-logo_16x16.png', APFDEMO_FILE ) |
|
59 | - * ) |
|
60 | - * : null, // do not call the function in the front-end. |
|
61 | - * |
|
62 | - * // (framework specific) this sets the screen icon for the post type for WordPress v3.7.1 or below. |
|
63 | - * // a file path can be passed instead of a url, plugins_url( 'asset/image/wp-logo_32x32.png', APFDEMO_FILE ) |
|
64 | - * 'screen_icon' => dirname( APFDEMO_FILE ) . '/asset/image/wp-logo_32x32.png', |
|
65 | - * |
|
66 | - * // [3.5.10+] (framework specific) default: true |
|
67 | - * 'show_submenu_add_new' => true, |
|
68 | - * |
|
69 | - * ) |
|
70 | - * );</code> |
|
71 | - * |
|
72 | - * <h4>Framework Specific Post Type Arguments</h4> |
|
73 | - * In addition to the post type argument structure defined by the WordPress core, there are arguments defined by the framework. |
|
74 | - * |
|
75 | - * - screen_icon - For WordPress 3.7.x or below, set an icon url or path for the 32x32 screen icon displayed in the post listing page. |
|
76 | - * - show_submenu_add_new [3.5.10+] |
|
77 | - |
|
78 | - * <h4>Framework Specific Post Type Label Arguments</h4> |
|
79 | - * - plugin_listing_table_title_cell_link' - If the caller script is a plugin, this determines the label of the action link embedded in the plugin listing page (plugins.php). |
|
80 | - * To disable the action link, set an empty string `''`. |
|
81 | - |
|
82 | - * |
|
83 | - * @since 2.0.0 |
|
84 | - * @since 2.1.6 Added the $sTextDomain parameter. |
|
85 | - * @see http://codex.wordpress.org/Function_Reference/register_post_type#Arguments |
|
86 | - * @param string The post type slug. |
|
87 | - * @param array The <a href="http://codex.wordpress.org/Function_Reference/register_post_type#Arguments">argument array</a> passed to register_post_type(). |
|
88 | - * @param string The path of the caller script. This is used to retrieve the script information to insert it into the footer. If not set, the framework tries to detect it. |
|
89 | - * @param string The text domain of the caller script. |
|
90 | - * @return void |
|
91 | - */ |
|
21 | + * The constructor of the class object. |
|
22 | + * |
|
23 | + * Registers necessary hooks and sets up internal properties. |
|
24 | + * |
|
25 | + * <h4>Example</h4> |
|
26 | + * <code>new APF_PostType( |
|
27 | + * 'apf_posts', // post type slug |
|
28 | + * array( |
|
29 | + * 'labels' => array( |
|
30 | + * 'name' => 'Demo', |
|
31 | + * 'all_items' => __( 'Sample Posts', 'admin-page-framework-demo' ), |
|
32 | + * 'singular_name' => 'Demo', |
|
33 | + * 'add_new' => __( 'Add New', 'admin-page-framework-demo' ), |
|
34 | + * 'add_new_item' => __( 'Add New APF Post', 'admin-page-framework-demo' ), |
|
35 | + * 'edit' => __( 'Edit', 'admin-page-framework-demo' ), |
|
36 | + * 'edit_item' => __( 'Edit APF Post', 'admin-page-framework-demo' ), |
|
37 | + * 'new_item' => __( 'New APF Post', 'admin-page-framework-demo' ), |
|
38 | + * 'view' => __( 'View', 'admin-page-framework-demo' ), |
|
39 | + * 'view_item' => __( 'View APF Post', 'admin-page-framework-demo' ), |
|
40 | + * 'search_items' => __( 'Search APF Post', 'admin-page-framework-demo' ), |
|
41 | + * 'not_found' => __( 'No APF Post found', 'admin-page-framework-demo' ), |
|
42 | + * 'not_found_in_trash' => __( 'No APF Post found in Trash', 'admin-page-framework-demo' ), |
|
43 | + * 'parent' => __( 'Parent APF Post', 'admin-page-framework-demo' ), |
|
44 | + * |
|
45 | + * // (framework specific) |
|
46 | + * 'plugin_listing_table_title_cell_link' => __( 'APF Posts', 'admin-page-framework-demo' ), // framework specific key. [3.0.6+] |
|
47 | + * ), |
|
48 | + * 'public' => true, |
|
49 | + * 'menu_position' => 110, |
|
50 | + * 'supports' => array( 'title' ), // e.g. array( 'title', 'editor', 'comments', 'thumbnail', 'excerpt' ), |
|
51 | + * 'taxonomies' => array( '' ), |
|
52 | + * 'has_archive' => true, |
|
53 | + * 'show_admin_column' => true, // [3.5+ core] this is for custom taxonomies to automatically add the column in the listing table. |
|
54 | + * 'menu_icon' => $this->oProp->bIsAdmin |
|
55 | + * ? ( |
|
56 | + * version_compare( $GLOBALS['wp_version'], '3.8', '>=' ) |
|
57 | + * ? 'dashicons-wordpress' |
|
58 | + * : plugins_url( 'asset/image/wp-logo_16x16.png', APFDEMO_FILE ) |
|
59 | + * ) |
|
60 | + * : null, // do not call the function in the front-end. |
|
61 | + * |
|
62 | + * // (framework specific) this sets the screen icon for the post type for WordPress v3.7.1 or below. |
|
63 | + * // a file path can be passed instead of a url, plugins_url( 'asset/image/wp-logo_32x32.png', APFDEMO_FILE ) |
|
64 | + * 'screen_icon' => dirname( APFDEMO_FILE ) . '/asset/image/wp-logo_32x32.png', |
|
65 | + * |
|
66 | + * // [3.5.10+] (framework specific) default: true |
|
67 | + * 'show_submenu_add_new' => true, |
|
68 | + * |
|
69 | + * ) |
|
70 | + * );</code> |
|
71 | + * |
|
72 | + * <h4>Framework Specific Post Type Arguments</h4> |
|
73 | + * In addition to the post type argument structure defined by the WordPress core, there are arguments defined by the framework. |
|
74 | + * |
|
75 | + * - screen_icon - For WordPress 3.7.x or below, set an icon url or path for the 32x32 screen icon displayed in the post listing page. |
|
76 | + * - show_submenu_add_new [3.5.10+] |
|
77 | + * <h4>Framework Specific Post Type Label Arguments</h4> |
|
78 | + * - plugin_listing_table_title_cell_link' - If the caller script is a plugin, this determines the label of the action link embedded in the plugin listing page (plugins.php). |
|
79 | + * To disable the action link, set an empty string `''`. |
|
80 | + * |
|
81 | + * @since 2.0.0 |
|
82 | + * @since 2.1.6 Added the $sTextDomain parameter. |
|
83 | + * @see http://codex.wordpress.org/Function_Reference/register_post_type#Arguments |
|
84 | + * @param string The post type slug. |
|
85 | + * @param array The <a href="http://codex.wordpress.org/Function_Reference/register_post_type#Arguments">argument array</a> passed to register_post_type(). |
|
86 | + * @param string The path of the caller script. This is used to retrieve the script information to insert it into the footer. If not set, the framework tries to detect it. |
|
87 | + * @param string The text domain of the caller script. |
|
88 | + * @return void |
|
89 | + */ |
|
92 | 90 | public function __construct( $sPostType, $aArguments=array(), $sCallerPath=null, $sTextDomain='admin-page-framework' ) { |
93 | 91 | |
94 | 92 | if ( empty( $sPostType ) ) { |
@@ -36,36 +36,36 @@ discard block |
||
36 | 36 | } |
37 | 37 | |
38 | 38 | /** |
39 | - * The method for necessary set-ups. |
|
40 | - * |
|
41 | - * <h4>Example</h4> |
|
42 | - * <code>public function setUp() { |
|
43 | - * $this->setAutoSave( false ); |
|
44 | - * $this->setAuthorTableFilter( true ); |
|
45 | - * $this->addTaxonomy( |
|
46 | - * 'sample_taxonomy', // taxonomy slug |
|
47 | - * array( // argument - for the argument array keys, refer to : http://codex.wordpress.org/Function_Reference/register_taxonomy#Arguments |
|
48 | - * 'labels' => array( |
|
49 | - * 'name' => 'Genre', |
|
50 | - * 'add_new_item' => 'Add New Genre', |
|
51 | - * 'new_item_name' => "New Genre" |
|
52 | - * ), |
|
53 | - * 'show_ui' => true, |
|
54 | - * 'show_tagcloud' => false, |
|
55 | - * 'hierarchical' => true, |
|
56 | - * 'show_admin_column' => true, |
|
57 | - * 'show_in_nav_menus' => true, |
|
58 | - * 'show_table_filter' => true, // framework specific key |
|
59 | - * 'show_in_sidebar_menus' => false, // framework specific key |
|
60 | - * ) |
|
61 | - * ); |
|
62 | - * }</code> |
|
63 | - * |
|
64 | - * @abstract |
|
65 | - * @since 2.0.0 |
|
66 | - * @remark The user should override this method in their class definition. |
|
67 | - * @remark A callback for the `wp_loaded` hook. |
|
68 | - */ |
|
39 | + * The method for necessary set-ups. |
|
40 | + * |
|
41 | + * <h4>Example</h4> |
|
42 | + * <code>public function setUp() { |
|
43 | + * $this->setAutoSave( false ); |
|
44 | + * $this->setAuthorTableFilter( true ); |
|
45 | + * $this->addTaxonomy( |
|
46 | + * 'sample_taxonomy', // taxonomy slug |
|
47 | + * array( // argument - for the argument array keys, refer to : http://codex.wordpress.org/Function_Reference/register_taxonomy#Arguments |
|
48 | + * 'labels' => array( |
|
49 | + * 'name' => 'Genre', |
|
50 | + * 'add_new_item' => 'Add New Genre', |
|
51 | + * 'new_item_name' => "New Genre" |
|
52 | + * ), |
|
53 | + * 'show_ui' => true, |
|
54 | + * 'show_tagcloud' => false, |
|
55 | + * 'hierarchical' => true, |
|
56 | + * 'show_admin_column' => true, |
|
57 | + * 'show_in_nav_menus' => true, |
|
58 | + * 'show_table_filter' => true, // framework specific key |
|
59 | + * 'show_in_sidebar_menus' => false, // framework specific key |
|
60 | + * ) |
|
61 | + * ); |
|
62 | + * }</code> |
|
63 | + * |
|
64 | + * @abstract |
|
65 | + * @since 2.0.0 |
|
66 | + * @remark The user should override this method in their class definition. |
|
67 | + * @remark A callback for the `wp_loaded` hook. |
|
68 | + */ |
|
69 | 69 | public function setUp() {} |
70 | 70 | |
71 | 71 | /* |
@@ -124,49 +124,49 @@ discard block |
||
124 | 124 | * Front-end methods |
125 | 125 | */ |
126 | 126 | /** |
127 | - * Enables or disables the auto-save feature in the custom post type's post submission page. |
|
128 | - * |
|
129 | - * <h4>Example</h4> |
|
130 | - * <code>$this->setAutoSave( false ); |
|
131 | - * </code> |
|
132 | - * |
|
133 | - * @since 2.0.0 |
|
134 | - * @param boolean If true, it enables the auto-save; otherwise, it disables it. |
|
135 | - * return void |
|
136 | - */ |
|
127 | + * Enables or disables the auto-save feature in the custom post type's post submission page. |
|
128 | + * |
|
129 | + * <h4>Example</h4> |
|
130 | + * <code>$this->setAutoSave( false ); |
|
131 | + * </code> |
|
132 | + * |
|
133 | + * @since 2.0.0 |
|
134 | + * @param boolean If true, it enables the auto-save; otherwise, it disables it. |
|
135 | + * return void |
|
136 | + */ |
|
137 | 137 | protected function setAutoSave( $bEnableAutoSave=True ) { |
138 | 138 | $this->oProp->bEnableAutoSave = $bEnableAutoSave; |
139 | 139 | } |
140 | 140 | |
141 | 141 | /** |
142 | - * Adds a custom taxonomy to the class post type. |
|
143 | - * <h4>Example</h4> |
|
144 | - * <code>$this->addTaxonomy( |
|
145 | - * 'sample_taxonomy', // taxonomy slug |
|
146 | - * array( // argument |
|
147 | - * 'labels' => array( |
|
148 | - * 'name' => 'Genre', |
|
149 | - * 'add_new_item' => 'Add New Genre', |
|
150 | - * 'new_item_name' => "New Genre" |
|
151 | - * ), |
|
152 | - * 'show_ui' => true, |
|
153 | - * 'show_tagcloud' => false, |
|
154 | - * 'hierarchical' => true, |
|
155 | - * 'show_admin_column' => true, |
|
156 | - * 'show_in_nav_menus' => true, |
|
157 | - * 'show_table_filter' => true, // framework specific key |
|
158 | - * 'show_in_sidebar_menus' => false, // framework specific key |
|
159 | - * ) |
|
160 | - * );</code> |
|
161 | - * |
|
162 | - * @see http://codex.wordpress.org/Function_Reference/register_taxonomy#Arguments |
|
163 | - * @since 2.0.0 |
|
164 | - * @since 3.1.1 Added the third parameter. |
|
165 | - * @param string $sTaxonomySlug The taxonomy slug. |
|
166 | - * @param array $aArgs The taxonomy argument array passed to the second parameter of the <a href="http://codex.wordpress.org/Function_Reference/register_taxonomy#Arguments">register_taxonomy()</a> function. |
|
167 | - * @param array $aAdditionalObjectTypes Additional object types (post types) besides the caller post type. |
|
168 | - * @return void |
|
169 | - */ |
|
142 | + * Adds a custom taxonomy to the class post type. |
|
143 | + * <h4>Example</h4> |
|
144 | + * <code>$this->addTaxonomy( |
|
145 | + * 'sample_taxonomy', // taxonomy slug |
|
146 | + * array( // argument |
|
147 | + * 'labels' => array( |
|
148 | + * 'name' => 'Genre', |
|
149 | + * 'add_new_item' => 'Add New Genre', |
|
150 | + * 'new_item_name' => "New Genre" |
|
151 | + * ), |
|
152 | + * 'show_ui' => true, |
|
153 | + * 'show_tagcloud' => false, |
|
154 | + * 'hierarchical' => true, |
|
155 | + * 'show_admin_column' => true, |
|
156 | + * 'show_in_nav_menus' => true, |
|
157 | + * 'show_table_filter' => true, // framework specific key |
|
158 | + * 'show_in_sidebar_menus' => false, // framework specific key |
|
159 | + * ) |
|
160 | + * );</code> |
|
161 | + * |
|
162 | + * @see http://codex.wordpress.org/Function_Reference/register_taxonomy#Arguments |
|
163 | + * @since 2.0.0 |
|
164 | + * @since 3.1.1 Added the third parameter. |
|
165 | + * @param string $sTaxonomySlug The taxonomy slug. |
|
166 | + * @param array $aArgs The taxonomy argument array passed to the second parameter of the <a href="http://codex.wordpress.org/Function_Reference/register_taxonomy#Arguments">register_taxonomy()</a> function. |
|
167 | + * @param array $aAdditionalObjectTypes Additional object types (post types) besides the caller post type. |
|
168 | + * @return void |
|
169 | + */ |
|
170 | 170 | protected function addTaxonomy( $sTaxonomySlug, array $aArgs, array $aAdditionalObjectTypes=array() ) { |
171 | 171 | |
172 | 172 | $sTaxonomySlug = $this->oUtil->sanitizeSlug( $sTaxonomySlug ); |
@@ -229,16 +229,16 @@ discard block |
||
229 | 229 | } |
230 | 230 | |
231 | 231 | /** |
232 | - * Sets whether the author drop-down filter is enabled/disabled in the post type post list table. |
|
233 | - * |
|
234 | - * <h4>Example</h4> |
|
235 | - * <code>$this->setAuthorTableFilter( true ); |
|
236 | - * </code> |
|
237 | - * |
|
238 | - * @since 2.0.0 |
|
239 | - * @param boolean $bEnableAuthorTableFileter If true, it enables the author filter; otherwise, it disables it. |
|
240 | - * @return void |
|
241 | - */ |
|
232 | + * Sets whether the author drop-down filter is enabled/disabled in the post type post list table. |
|
233 | + * |
|
234 | + * <h4>Example</h4> |
|
235 | + * <code>$this->setAuthorTableFilter( true ); |
|
236 | + * </code> |
|
237 | + * |
|
238 | + * @since 2.0.0 |
|
239 | + * @param boolean $bEnableAuthorTableFileter If true, it enables the author filter; otherwise, it disables it. |
|
240 | + * @return void |
|
241 | + */ |
|
242 | 242 | protected function setAuthorTableFilter( $bEnableAuthorTableFileter=false ) { |
243 | 243 | $this->oProp->bEnableAuthorTableFileter = $bEnableAuthorTableFileter; |
244 | 244 | } |
@@ -69,7 +69,7 @@ |
||
69 | 69 | return "{$_aField['field_id']}{$_sKey}"; |
70 | 70 | } |
71 | 71 | |
72 | - /** |
|
72 | + /** |
|
73 | 73 | * Adds input fields |
74 | 74 | * |
75 | 75 | * @internal |
@@ -44,22 +44,22 @@ |
||
44 | 44 | } |
45 | 45 | |
46 | 46 | /** |
47 | - * The method for necessary set-ups. |
|
48 | - * |
|
49 | - * <h4>Example</h4> |
|
50 | - * <code> |
|
51 | - * public function setUp() { |
|
52 | - * $this->setArguments( |
|
53 | - * array( |
|
54 | - * 'description' => __( 'This is a sample widget with built-in field types created by Admin Page Framework.', 'admin-page-framework-demo' ), |
|
55 | - * ) |
|
56 | - * ); |
|
57 | - * } |
|
58 | - * </code> |
|
59 | - * |
|
60 | - * @abstract |
|
61 | - * @since 3.2.0 |
|
62 | - */ |
|
47 | + * The method for necessary set-ups. |
|
48 | + * |
|
49 | + * <h4>Example</h4> |
|
50 | + * <code> |
|
51 | + * public function setUp() { |
|
52 | + * $this->setArguments( |
|
53 | + * array( |
|
54 | + * 'description' => __( 'This is a sample widget with built-in field types created by Admin Page Framework.', 'admin-page-framework-demo' ), |
|
55 | + * ) |
|
56 | + * ); |
|
57 | + * } |
|
58 | + * </code> |
|
59 | + * |
|
60 | + * @abstract |
|
61 | + * @since 3.2.0 |
|
62 | + */ |
|
63 | 63 | public function setUp() {} |
64 | 64 | |
65 | 65 | /** |