Description
oik-types – Custom Post Types pageProcessing depends on the button that was pressed. There should only be one!
| Selection | Validate? | Perform action | Display preview | Display add | Display edit | Display select list |
|---|---|---|---|---|---|---|
| preview_type | No | n/a | Yes | – | – | - |
| delete_type | No | delete selected type | – | – | – | Yes |
| edit_type | No | n/a | – | – | Yes | Yes |
| _oik_cpt_edit_type | Yes | update selected type | – | – | Yes | Yes |
Usage
oikcpt_lazy_types_do_page();Parameters
Returns
voidSource
File name: oik-types/admin/oik-types.phpLines:
1 to 54 of 54
function oikcpt_lazy_types_do_page() { BW_::oik_menu_header( __( "types", "oik-types" ), "w100pc" ); $validated = false; $preview_type = bw_array_get( $_REQUEST, "preview_type", null ); $delete_type = bw_array_get( $_REQUEST, "delete_type", null ); $edit_type = bw_array_get( $_REQUEST, "edit_type", null ); /** These codes override the ones from the list... but why do we need to do it? * Do we have to receive the others in the $_REQUEST **?** * */ $oik_cpt_edit_type = bw_array_get( $_REQUEST, "_oik_cpt_edit_type", null ); $oik_cpt_add_oik_cpt = bw_array_get( $_REQUEST, "_oik_cpt_add_oik_cpt", null ); $oik_cpt_add_type = bw_array_get( $_REQUEST, "_oik_cpt_add_type", null ); if ( $oik_cpt_add_type || $oik_cpt_add_oik_cpt ) { $preview_type = null; $delete_type = null; $edit_type = null; } if ( $preview_type ) { BW_::oik_box( NULL, NULL, __( "Preview", "oik-types" ), "oik_cpt_preview" ); } if ( $delete_type ) { _oik_cpt_delete_type( $delete_type ); } if ( $edit_type ) { bw_build_overridden_type( $edit_type ); } if ( $oik_cpt_edit_type ) { $validated = _oik_cpt_type_validate( false ); } if ( $oik_cpt_add_oik_cpt ) { $validated = _oik_cpt_type_validate( true ); } if ( $oik_cpt_add_type || ( $oik_cpt_add_oik_cpt && !$validated ) ) { BW_::oik_box( NULL, NULL, __( "Add new", "oik-types" ), "oik_cpt_add_oik_cpt" ); } if ( $edit_type || $oik_cpt_edit_type || $validated ) { BW_::oik_box( null, null, __( "Edit type", "oik-types" ), "oik_cpt_edit_type" ); } BW_::oik_box( NULL, NULL, __( "types", "oik-types" ) , "oik_cpt_types" ); //oik_box( NULL, NULL, "registered types", "oik_cpt_registered_types" ); BW_::oik_box( null, null, __( "registered types", "oik-types" ), "oik_cpt_registered_types" ); oik_menu_footer(); bw_flush(); }View on GitHub
Invoked by
Calls
1 to 5 of 5
- bw_array_get() – Return the array[index] or array->index (for an object) or a default value if not set
- bw_build_overridden_type() – Build the overridden post_type definition
- bw_flush() – Use bw_flush() to echo the contents of $bwecho then empty it
- _oik_cpt_delete_type() –
- _oik_cpt_type_validate() – Validate the oik custom post type definition
