NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

<?php

/**
* Custom Post Type
* Author EgensLab
* @since 1.1.0
* */

if (!defined('ABSPATH')) {
exit(); //exit if access directly
}
if (!class_exists('zenfy_Custom_Post_Type')) {
class zenfy_Custom_Post_Type
{

//$instance variable
private static $instance;

public function __construct()
{
//register post type
add_action('init', array($this, 'register_custom_post_type'));
}

/**
* get Instance
* @since 2.0.0
* */
public static function getInstance()
{
if (null == self::$instance) {
self::$instance = new self();
}

return self::$instance;
}

/**
* Register Custom Post Type
* @since 2.0.0
* */
public function register_custom_post_type()
{
$all_post_type = array(

// Custome post case-study
[
'post_type' => 'case-study',
'args' => array(
'label' => esc_html__('Case Study', 'zenfy-core'),
'description' => esc_html__('Case Study', 'zenfy-core'),
'menu_icon' => 'dashicons-media-spreadsheet',
'labels' => array(
'name' => esc_html_x('Case Study', 'Post Type General Name', 'zenfy-core'),
'singular_name' => esc_html_x('Case Study', 'Post Type Singular Name', 'zenfy-core'),
'menu_name' => esc_html__('Case Study', 'zenfy-core'),
'all_items' => esc_html__('All Case Study', 'zenfy-core'),
'view_item' => esc_html__('View Case Study', 'zenfy-core'),
'add_new_item' => esc_html__('Add New Case Study', 'zenfy-core'),
'add_new' => esc_html__('Add New Case Study', 'zenfy-core'),
'edit_item' => esc_html__('Edit Case Study', 'zenfy-core'),
'update_item' => esc_html__('Update Case Study', 'zenfy-core'),
'search_items' => esc_html__('Search Case Study', 'zenfy-core'),
'not_found' => esc_html__('Not Found', 'zenfy-core'),
'not_found_in_trash' => esc_html__('Not found in Trash', 'zenfy-core'),
),
'supports' => array('title', 'editor', 'excerpt', 'thumbnail'),
'hierarchical' => true,
'public' => true,
'has_archive' => true,
"publicly_queryable" => true,
'show_ui' => true,
"rewrite" => array('slug' => 'case-study', 'with_front' => true),
'exclude_from_search' => false,
'can_export' => true,
'capability_type' => 'post',
'query_var' => true,
"show_in_rest" => true,
)
],

// Custome post Portfolio
[
'post_type' => 'portfolio',
'args' => array(
'label' => esc_html__('Portfolio', 'zenfy-core'),
'description' => esc_html__('Portfolio', 'zenfy-core'),
'menu_icon' => 'dashicons-edit-page',
'labels' => array(
'name' => esc_html_x('Portfolio', 'Post Type General Name', 'zenfy-core'),
'singular_name' => esc_html_x('Portfolio', 'Post Type Singular Name', 'zenfy-core'),
'menu_name' => esc_html__('Portfolio', 'zenfy-core'),
'all_items' => esc_html__('All Portfolio', 'zenfy-core'),
'view_item' => esc_html__('View Portfolio', 'zenfy-core'),
'add_new_item' => esc_html__('Add New Portfolio', 'zenfy-core'),
'add_new' => esc_html__('Add New Portfolio', 'zenfy-core'),
'edit_item' => esc_html__('Edit Portfolio', 'zenfy-core'),
'update_item' => esc_html__('Update Portfolio', 'zenfy-core'),
'search_items' => esc_html__('Search Portfolio', 'zenfy-core'),
'not_found' => esc_html__('Not Found', 'zenfy-core'),
'not_found_in_trash' => esc_html__('Not found in Trash', 'zenfy-core'),
),
'supports' => array('title', 'editor', 'excerpt', 'thumbnail'),
'hierarchical' => true,
'public' => true,
'has_archive' => true,
"publicly_queryable" => true,
'show_ui' => true,
"rewrite" => array('slug' => 'portfolio', 'with_front' => true),
'exclude_from_search' => false,
'can_export' => true,
'capability_type' => 'post',
'query_var' => true,
"show_in_rest" => true,
)
],
);

if (!empty($all_post_type) && is_array($all_post_type)) {
foreach ($all_post_type as $post_type) {
call_user_func_array('register_post_type', $post_type);
}
}

/**
* Custom Taxonomy Register
*/
$all_custom_taxonmy = array(

// Taxonomy for case-study post
array(
'taxonomy' => 'case-category',
'object_type' => 'case-study',
'args' => array(
"labels" => array(
"name" => esc_html__("Categories", 'zenfy-core'),
"singular_name" => esc_html__("Categories", 'zenfy-core'),
"menu_name" => esc_html__("Categories", 'zenfy-core'),
"all_items" => esc_html__("All Case Categories", 'zenfy-core'),
"add_new_item" => esc_html__("Add New Category", 'zenfy-core')
),
"public" => true,
"hierarchical" => true,
'has_archive' => true,
"show_ui" => true,
"show_in_menu" => true,
"show_in_nav_menus" => true,
"rewrite" => array('slug' => 'case-category', 'with_front' => true),
"query_var" => true,
"show_admin_column" => true,
"show_in_rest" => true,
"show_in_quick_edit" => true,
)
),

// Tag for case-study post
array(
'taxonomy' => 'case-tag',
'object_type' => 'case-study',
'args' => array(
"labels" => array(
"name" => esc_html__("Tags", 'zenfy-core'),
"singular_name" => esc_html__("Tags", 'zenfy-core'),
"menu_name" => esc_html__("Tags", 'zenfy-core'),
"all_items" => esc_html__("All Tags", 'zenfy-core'),
"add_new_item" => esc_html__("Add New Tags", 'zenfy-core')
),
"public" => true,
"hierarchical" => false,
'has_archive' => true,
"show_ui" => true,
"show_in_menu" => true,
"show_in_nav_menus" => true,
"rewrite" => array('slug' => 'case-tag', 'with_front' => true),
"query_var" => true,
"show_admin_column" => true,
"show_in_rest" => true,
"show_in_quick_edit" => true,
'meta_box_cb' => 'post_tags_meta_box',
)
),

// Taxonomy for portfolio post
array(
'taxonomy' => 'portfolio-category',
'object_type' => 'portfolio',
'args' => array(
"labels" => array(
"name" => esc_html__("Categories", 'zenfy-core'),
"singular_name" => esc_html__("Categories", 'zenfy-core'),
"menu_name" => esc_html__("Categories", 'zenfy-core'),
"all_items" => esc_html__("All Portfolio Categories", 'zenfy-core'),
"add_new_item" => esc_html__("Add New Category", 'zenfy-core')
),
"public" => true,
"hierarchical" => true,
'has_archive' => true,
"show_ui" => true,
"show_in_menu" => true,
"show_in_nav_menus" => true,
"rewrite" => array('slug' => 'portfolio-category', 'with_front' => true),
"query_var" => true,
"show_admin_column" => true,
"show_in_rest" => true,
"show_in_quick_edit" => true,
)
),

// Tag for portfolio post
array(
'taxonomy' => 'portfolio-tag',
'object_type' => 'portfolio',
'args' => array(
"labels" => array(
"name" => esc_html__("Tags", 'zenfy-core'),
"singular_name" => esc_html__("Tags", 'zenfy-core'),
"menu_name" => esc_html__("Tags", 'zenfy-core'),
"all_items" => esc_html__("All Tags", 'zenfy-core'),
"add_new_item" => esc_html__("Add New Tags", 'zenfy-core')
),
"public" => true,
"hierarchical" => false,
'has_archive' => true,
"show_ui" => true,
"show_in_menu" => true,
"show_in_nav_menus" => true,
"rewrite" => array('slug' => 'portfolio-tag', 'with_front' => true),
"query_var" => true,
"show_admin_column" => true,
"show_in_rest" => true,
"show_in_quick_edit" => true,
'meta_box_cb' => 'post_tags_meta_box',
)
),

);
if (is_array($all_custom_taxonmy) && !empty($all_custom_taxonmy)) {
foreach ($all_custom_taxonmy as $taxonomy) {
call_user_func_array('register_taxonomy', $taxonomy);
}
}

flush_rewrite_rules();
}
} //end class

if (class_exists('zenfy_Custom_Post_Type')) {
zenfy_Custom_Post_Type::getInstance();
}
}
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.