"; register_post_type( 'apb', [ 'labels' => [ 'name' => __( 'Advanced Posts', 'advanced-post-block'), 'singular_name' => __( 'Advanced Posts', 'advanced-post-block' ), 'add_new' => __( 'Add New', 'advanced-post-block' ), 'add_new_item' => __( 'Add New', 'advanced-post-block' ), 'edit_item' => __( 'Edit', 'advanced-post-block' ), 'new_item' => __( 'New', 'advanced-post-block' ), 'view_item' => __( 'View', 'advanced-post-block' ), 'search_items' => __( 'Search', 'advanced-post-block'), 'not_found' => __( 'Sorry, we couldn\'t find the that you are looking for.', 'advanced-post-block' ) ], 'public' => false, 'show_ui' => true, 'show_in_rest' => true, 'publicly_queryable' => false, 'exclude_from_search' => true, 'menu_position' => 14, 'menu_icon' => 'data:image/svg+xml;base64,' . base64_encode($menuIcon), 'has_archive' => false, 'hierarchical' => false, 'capability_type' => 'page', 'rewrite' => [ 'slug' => 'apb' ], 'supports' => [ 'title', 'editor' ], 'template' => [ ['ap-block/posts'] ], 'template_lock' => 'all', ]); // Register Post Type } function onAddShortcode( $atts ) { $post_id = $atts['id']; $post = get_post($post_id); $content = $post->post_content; $blocks = parse_blocks($content); ob_start(); echo render_block($blocks[0]); return ob_get_clean(); } function manageAPBPostsColumns($defaults) { unset($defaults['date']); $defaults['shortcode'] = 'ShortCode'; $defaults['date'] = 'Date'; return $defaults; } function manageAPBPostsCustomColumns($column_name, $post_ID) { if ($column_name == 'shortcode') { echo "
Copy To Clipboard
"; } } } new APBCustomPost();