$this->get_option('name'), 'singular_name' => $this->get_option('singular_name') ); $args = array( 'labels' => $labels, 'description' => $this->get_option('description'), 'public' => false, 'publicly_queryable' => false, 'show_ui' => false, 'show_in_menu' => false, 'query_var' => false, 'rewrite' => false, 'capability_type' => 'post', 'has_archive' => false, 'hierarchical' => false, 'supports' => array() ); register_post_type( 'ai_robot_forms', $args ); } /** * Module options * * @since 1.0 * @return array */ public function options() { return array( 'name' => __('Custom Forms', 'ai-robot'), 'singular_name' => __('Custom Form', 'ai-robot'), 'description' => __( "Custom forms, conditional forms, etc. Choose from our library of forms or create a new one from scratch.", 'ai-robot' ), 'button_label' => __( "New Custom Form", 'ai-robot' ), 'icon' => '' ); } /** * Order templates by priority * * @since 1.0 * @param $a * @param $b * * @return int */ public function order_templates( $b, $a ) { if( isset( $a->options['priority'] ) && isset( $b->options['priority'] ) ) { return $a->options['priority'] < $b->options['priority']; } } /** * Get templates * * @since 1.0 * @return array */ public function get_templates() { usort( $this->templates, array( $this, "order_templates" ) ); return $this->templates; } } endif;