File "post.php"
Full Path: /home2/sdektunc/cepali.edu.mx/wp-includes/blocks/legacy-widget/post.php
File size: 4 KB
MIME-type: text/x-php
Charset: utf-8
<?php
/**
* Core Post API
*
* @package WordPress
* @subpackage Post
*/
//
// Post Type registration.
//
/**
* Creates the initial post types when 'init' action is fired.
*
* See {@see 'init'}.
*
* @since 2.9.0
*/
function create_initial_post_types() {
WP_Post_Type::reset_default_labels();
register_post_type(
'post',
array(
'labels' => array(
'name_admin_bar' => _x( 'Post', 'add new from admin bar' ),
),
'public' => true,
'_builtin' => true, /* internal use only. don't use this when registering your own post type. */
'_edit_link' => 'post.php?post=%d', /* internal use only. don't use this when registering your own post type. */
'capability_type' => 'post',
'map_meta_cap' => true,
'menu_position' => 5,
'menu_icon' => 'dashicons-admin-post',
'hierarchical' => false,
'rewrite' => false,
'query_var' => false,
'delete_with_user' => true,
'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'trackbacks', 'custom-fields', 'comments', 'revisions', 'post-formats' ),
'show_in_rest' => true,
'rest_base' => 'posts',
'rest_controller_class' => 'WP_REST_Posts_Controller',
)
);
register_post_type(
'page',
array(
'labels' => array(
'name_admin_bar' => _x( 'Page', 'add new from admin bar' ),
),
'public' => true,
'publicly_queryable' => false,
'_builtin' => true, /* internal use only. don't use this when registering your own post type. */
'_edit_link' => 'post.php?post=%d', /* internal use only. don't use this when registering your own post type. */
'capability_type' => 'page',
'map_meta_cap' => true,
'menu_position' => 20,
'menu_icon' => 'dashicons-admin-page',
'hierarchical' => true,
'rewrite' => false,
'query_var' => false,
'delete_with_user' => true,
'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'page-attributes', 'custom-fields', 'comments', 'revisions' ),
'show_in_rest' => true,
'rest_base' => 'pages',
'rest_controller_class' => 'WP_REST_Posts_Controller',
)
);
register_post_type(
'attachment',
array(
'labels' => array(
'name' => _x( 'Media', 'post type general name' ),
'name_admin_bar' => _x( 'Media', 'add new from admin bar' ),
'add_new' => __( 'Add New Media File' ),
'edit_item' => __( 'Edit Media' ),
'view_item' => ( '1' === get_option( 'wp_attachment_pages_enabled' ) ) ? __( 'View Attachment Page' ) : __( 'View Media File' ),
'attributes' => __( 'Attachment Attributes' ),
),
'public' => true,
'show_ui' => true,
'_builtin' => true, /* internal use only. don't use this when registering your own post type. */
'_edit_link' => 'post.php?post=%d', /* internal use only. don't use this when registering your own post type. */
'capability_type' => 'post',
'capabilities' => array(
'create_posts' => 'upload_files',
),
'map_meta_cap' => true,
'menu_icon' => 'dashicons-admin-media',
'hierarchical' => false,
'rewrite' => false,
'query_var' => false,
'show_in_nav_menus' => false,
'delete_with_user' => true,
'supports' => array( 'title', 'author', 'comments' ),
'show_in_rest' => true,
'rest_base' => 'media',
'rest_controller_class' => 'WP_REST_Attachments_Controller',
)
);
add_post_type_support( 'attachment:audio', 'thumbnail' );
add_post_type_support( 'attachment:video', 'thumbnail' );
register_post_type(
'revision',
array(
'labels' => array(
'name' => __( 'Revisions' ),
'singular_name' => __( 'Revisi