Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Nuorodų duomenų bazė (lietuviška versija)

if ( ! function_exists('_anwp_plugin_name_links_db_cpt') ) {

// Register Custom Post Type
function _anwp_plugin_name_links_db_cpt() {

	$labels = array(
		'name'                  => _x( 'Nuorodos', 'Post Type General Name', '_anwp-plugin-name' ),
		'singular_name'         => _x( 'Nuoroda', 'Post Type Singular Name', '_anwp-plugin-name' ),
		'menu_name'             => __( 'Nuorodos', '_anwp-plugin-name' ),
		'name_admin_bar'        => __( 'Nuoroda', '_anwp-plugin-name' ),
		'archives'              => __( 'Nuorodų archyvas', '_anwp-plugin-name' ),
		'attributes'            => __( 'Nuorodos atributai', '_anwp-plugin-name' ),
		'parent_item_colon'     => __( 'Tėvinė nuoroda:', '_anwp-plugin-name' ),
		'all_items'             => __( 'Visos nuorodos', '_anwp-plugin-name' ),
		'add_new_item'          => __( 'Pridėti naują nuorodą', '_anwp-plugin-name' ),
		'add_new'               => __( 'Pridėti naują', '_anwp-plugin-name' ),
		'new_item'              => __( 'Nauja nuoroda', '_anwp-plugin-name' ),
		'edit_item'             => __( 'Redaguoti nuorodą', '_anwp-plugin-name' ),
		'update_item'           => __( 'Atnaujinti nuorodą', '_anwp-plugin-name' ),
		'view_item'             => __( 'Rodyti nuorodą', '_anwp-plugin-name' ),
		'view_items'            => __( 'Rodyti nuorodas', '_anwp-plugin-name' ),
		'search_items'          => __( 'Ieškoti nuorodos', '_anwp-plugin-name' ),
		'not_found'             => __( 'Nerasta', '_anwp-plugin-name' ),
		'not_found_in_trash'    => __( 'Šiukšlinėje nerasta', '_anwp-plugin-name' ),
		'featured_image'        => __( 'Pagrindinis paveikslėlis', '_anwp-plugin-name' ),
		'set_featured_image'    => __( 'Nustatyti pagrindinį paveikslėlį', '_anwp-plugin-name' ),
		'remove_featured_image' => __( 'Panaikinti pagrindinį paveikslėlį', '_anwp-plugin-name' ),
		'use_featured_image'    => __( 'Naudoti kaip pagrindinį paveikslėlį', '_anwp-plugin-name' ),
		'insert_into_item'      => __( 'Įterpti į nuorodą', '_anwp-plugin-name' ),
		'uploaded_to_this_item' => __( 'Atsiųsta į šią nuorodą', '_anwp-plugin-name' ),
		'items_list'            => __( 'Nuorodų sąrašas', '_anwp-plugin-name' ),
		'items_list_navigation' => __( 'Nuorodų sąrašo navigacija', '_anwp-plugin-name' ),
		'filter_items_list'     => __( 'Filtruoti nuorodų sąrašą', '_anwp-plugin-name' ),
	);
	$rewrite = array(
		'slug'                  => 'nuoroda',
		'with_front'            => true,
		'pages'                 => true,
		'feeds'                 => false,
	);
	$args = array(
		'label'                 => __( 'Nuoroda', '_anwp-plugin-name' ),
		'description'           => __( 'Nuorodų duomenų bazė', '_anwp-plugin-name' ),
		'labels'                => $labels,
		'supports'              => array( 'title', 'editor', 'thumbnail', 'comments', 'custom-fields', 'page-attributes' ),
		'taxonomies'            => array( 'nuorodos_kategorija', 'nuorodos_zyma' ),
		'hierarchical'          => false,
		'public'                => true,
		'show_ui'               => true,
		'show_in_menu'          => true,
		'menu_position'         => 5,
		'menu_icon'             => 'dashicons-admin-links',
		'show_in_admin_bar'     => true,
		'show_in_nav_menus'     => false,
		'can_export'            => true,
		'has_archive'           => 'nuorodos',
		'exclude_from_search'   => false,
		'publicly_queryable'    => true,
		'rewrite'               => $rewrite,
		'capability_type'       => 'page',
		'show_in_rest'          => true,
		'rest_base'             => 'nuorodos',
	);
	register_post_type( 'anwp_nuorodos', $args );

}
add_action( 'init', '_anwp_plugin_name_links_db_cpt', 0 );

}