update wp plugin

This commit is contained in:
Egor Svitin
2019-02-19 11:47:36 +02:00
parent c565717fc1
commit aa0b5a12a2
2 changed files with 74 additions and 1 deletions

2
.gitignore vendored
View File

@@ -6,7 +6,6 @@ htdocs/*
!htdocs/wp-config-local-sample.php !htdocs/wp-config-local-sample.php
htdocs/wp-content/* htdocs/wp-content/*
htdocs/wp-content/plugins/faq
!htdocs/wp-content/mu-plugins/ !htdocs/wp-content/mu-plugins/
!htdocs/wp-content/plugins/ !htdocs/wp-content/plugins/
!htdocs/wp-content/themes/ !htdocs/wp-content/themes/
@@ -18,6 +17,7 @@ htdocs/wp-content/mu-plugins/*
htdocs/wp-content/plugins/* htdocs/wp-content/plugins/*
!htdocs/wp-content/plugins/index.php !htdocs/wp-content/plugins/index.php
!htdocs/wp-content/plugins/faq
htdocs/wp-content/themes/* htdocs/wp-content/themes/*
!htdocs/wp-content/themes/lawcarta !htdocs/wp-content/themes/lawcarta

View File

@@ -0,0 +1,73 @@
<?php
/*
Plugin Name: FAQ plugin
Description: Add faq pages and categories.
Author: LawCarta Team
Text Domain: faq
Version: 0.1
*/
function create_category_type()
{
// Add a taxonomy like categories
$labels = array(
'name' => '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');