Description
Register the oik-themes custom post type- The description is the content field
- The title should contain the theme slug and the theme description
- The featured image is for the theme banner
- You can also manually create excerpts
Usage
oik_register_oik_theme();Parameters
Returns
voidSource
File name: oik-themes/oik-themes.phpLines:
1 to 47 of 47
function oik_register_oik_theme() { $post_type = 'oik-themes'; $post_type_args = array(); $post_type_args['label'] = __( 'Themes', "oik" ); $post_type_args['description'] = __( 'WordPress theme', "oik" ); $post_type_args['supports'] = array( 'title', 'editor', 'thumbnail', 'excerpt' ); $post_type_args['has_archive'] = true; $post_type_args['menu_icon'] = 'dashicons-admin-appearance'; $post_type_args['show_in_rest'] = true; $post_type_args['rest_base'] = 'oik-themes'; $post_type_args['rest_controller_class'] = 'WP_REST_Posts_Controller'; bw_register_post_type( $post_type, $post_type_args ); bw_register_field( "_oikth_type", "select", "Theme type", array( '#options' => bw_theme_types() ) ); bw_register_field( "_oikth_slug", "text", "Theme name" ); bw_register_field( "_oikth_desc", "text", "Description" ); bw_register_field( "_oikth_demo", "URL", "Live demonstration" ); bw_register_field( "_oikth_template", "noderef", "Template", array( '#type' => 'oik-themes', '#optional' => true ) ); // Parent theme name /** Currently we support two different systems for delivering themium themes: WooCommerce and Easy Digital Downloads * The Purchasable product should be completed for each themium oik theme (and Other themium theme? ) */ $purchasable_product_type = array(); $purchasable_product_type[] = "download"; $purchasable_product_type[] = "product"; bw_register_field( "_oikth_prod", "noderef", "Purchasable product", array( '#type' => $purchasable_product_type, '#optional' => true, '#theme_null' => false ) ); bw_register_field_for_object_type( "_component_version", $post_type ); bw_register_field_for_object_type( "_oikth_type", $post_type ); bw_register_field_for_object_type( "_oikth_slug", $post_type ); //bw_register_field_for_object_type( "_oikth_name", $post_type ); bw_register_field_for_object_type( "_oikth_desc", $post_type ); bw_register_field_for_object_type( "_oikth_prod", $post_type ); bw_register_field_for_object_type( "_oikth_demo", $post_type ); bw_register_field_for_object_type( "_oikth_template", $post_type ); bw_register_field_for_object_type( "_oikth_templates_count", $post_type ); bw_register_field_for_object_type( "_oikth_parts_count", $post_type ); bw_register_field_for_object_type( "_oikth_patterns_count", $post_type ); bw_register_field_for_object_type( '_oikth_styles_count', $post_type ); bw_register_field_for_object_type( "_oikp_git", $post_type ); oikth_columns_and_titles( $post_type ); }View on GitHub
Invoked by
Calls
1 to 2 of 2
Call hooks
API Letters:
