From aa0b5a12a2592226d9f84140937e598302693959 Mon Sep 17 00:00:00 2001 From: Egor Svitin Date: Tue, 19 Feb 2019 11:47:36 +0200 Subject: [PATCH] update wp plugin --- .gitignore | 2 +- htdocs/wp-content/plugins/faq/Faq.php | 73 +++++++++++++++++++++++++++ 2 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 htdocs/wp-content/plugins/faq/Faq.php diff --git a/.gitignore b/.gitignore index 0f91f93..d083191 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,6 @@ htdocs/* !htdocs/wp-config-local-sample.php htdocs/wp-content/* -htdocs/wp-content/plugins/faq !htdocs/wp-content/mu-plugins/ !htdocs/wp-content/plugins/ !htdocs/wp-content/themes/ @@ -18,6 +17,7 @@ htdocs/wp-content/mu-plugins/* htdocs/wp-content/plugins/* !htdocs/wp-content/plugins/index.php +!htdocs/wp-content/plugins/faq htdocs/wp-content/themes/* !htdocs/wp-content/themes/lawcarta diff --git a/htdocs/wp-content/plugins/faq/Faq.php b/htdocs/wp-content/plugins/faq/Faq.php new file mode 100644 index 0000000..a037e49 --- /dev/null +++ b/htdocs/wp-content/plugins/faq/Faq.php @@ -0,0 +1,73 @@ + 'Categories', + 'singular_name' => 'Category', + 'search_items' => 'Search Categories', + 'all_items' => 'All Categories', + 'parent_item' => 'Parent Category', + 'parent_item_colon' => 'Parent Category:', + 'edit_item' => 'Edit Category', + 'update_item' => 'Update Category', + 'add_new_item' => 'Add New Category', + 'new_item_name' => 'New Category Name', + 'menu_name' => 'Categories', + ); + + $args = array( + 'hierarchical' => true, + 'labels' => $labels, + 'show_ui' => true, + 'show_admin_column' => true, + 'show_in_admin_bar' => true, + 'query_var' => true, + //'rewrite' => array( 'slug' => 'type' ), + ); + + register_taxonomy('fac_category_type',['fac'],$args); + + // Add a taxonomy like tags + $labels = array( + 'name' => 'Answer', + 'singular_name' => 'Answer', + 'search_items' => 'Answers', + 'popular_items' => 'Popular Answers', + 'all_items' => 'All Answers', + 'parent_item' => 'Category', + 'parent_item_colon' => 'Category:', + 'edit_item' => 'Edit Answer', + 'update_item' => 'Update Answer', + 'add_new_item' => 'Add New Answer', + 'new_item_name' => 'New Answer Name', + 'add_or_remove_items' => 'Add or remove Answer', + 'menu_name' => 'Answers', + ); + + $args = array( + 'hierarchical' => false, + 'labels' => $labels, + 'public' => true, + 'show_ui' => true, + 'show_in_admin_bar' => true, + 'taxonomies' => ['fac_category_type'], + 'show_admin_column' => true, + 'query_var' => true, + 'publicly_queryable' => true, + 'rewrite' => array( 'slug' => 'faq/answer' ), + ); + + register_post_type( 'fac_category_answer', $args ); + +} + +add_action('init','create_category_type'); \ No newline at end of file