Last active
May 8, 2025 15:35
-
-
Save garubi/bd2db26e3ee9e29829f36d157bf460c0 to your computer and use it in GitHub Desktop.
WordPress Playground Blueprint to replicate a Co-Authors Plus plugin issue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function pandora_sedi() { | |
| $labels = array( | |
| 'name' => _x( 'Sedi', 'Post Type General Name', 'text_domain' ), | |
| 'singular_name' => _x( 'Sede', 'Post Type Singular Name', 'text_domain' ), | |
| 'menu_name' => __( 'Sedi', 'text_domain' ), | |
| 'name_admin_bar' => __( 'Sedi', 'text_domain' ), | |
| 'archives' => __( 'Item Archives', 'text_domain' ), | |
| 'attributes' => __( 'Item Attributes', 'text_domain' ), | |
| 'parent_item_colon' => __( 'Parent Item:', 'text_domain' ), | |
| 'all_items' => __( 'All Items', 'text_domain' ), | |
| 'add_new_item' => __( 'Add New Item', 'text_domain' ), | |
| 'add_new' => __( 'Add New', 'text_domain' ), | |
| 'new_item' => __( 'New Item', 'text_domain' ), | |
| 'edit_item' => __( 'Edit Item', 'text_domain' ), | |
| 'update_item' => __( 'Update Item', 'text_domain' ), | |
| 'view_item' => __( 'View Item', 'text_domain' ), | |
| 'view_items' => __( 'View Items', 'text_domain' ), | |
| 'search_items' => __( 'Search Item', 'text_domain' ), | |
| 'not_found' => __( 'Not found', 'text_domain' ), | |
| 'not_found_in_trash' => __( 'Not found in Trash', 'text_domain' ), | |
| 'featured_image' => __( 'Featured Image', 'text_domain' ), | |
| 'set_featured_image' => __( 'Set featured image', 'text_domain' ), | |
| 'remove_featured_image' => __( 'Remove featured image', 'text_domain' ), | |
| 'use_featured_image' => __( 'Use as featured image', 'text_domain' ), | |
| 'insert_into_item' => __( 'Insert into item', 'text_domain' ), | |
| 'uploaded_to_this_item' => __( 'Uploaded to this item', 'text_domain' ), | |
| 'items_list' => __( 'Items list', 'text_domain' ), | |
| 'items_list_navigation' => __( 'Items list navigation', 'text_domain' ), | |
| 'filter_items_list' => __( 'Filter items list', 'text_domain' ), | |
| ); | |
| $args = array( | |
| 'label' => __( 'Sede', 'text_domain' ), | |
| 'description' => __( 'Post Type Description', 'text_domain' ), | |
| 'labels' => $labels, | |
| 'supports' => array( 'title', 'editor', 'author', 'custom-fields', 'page-attributes', 'comments' ), | |
| 'hierarchical' => false, | |
| 'public' => true, | |
| 'menu_icon' => 'dashicons-building', | |
| 'show_ui' => true, | |
| 'show_in_menu' => true, | |
| 'menu_position' => 5, | |
| 'show_in_admin_bar' => true, | |
| 'show_in_nav_menus' => true, | |
| 'can_export' => true, | |
| 'has_archive' => true, | |
| 'exclude_from_search' => false, | |
| 'publicly_queryable' => true, | |
| 'capability_type' => 'page', | |
| ); | |
| register_post_type( 'sedi', $args ); | |
| } | |
| add_action( 'init', 'pandora_sedi', 0 ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8" ?> | |
| <!-- This is a WordPress eXtended RSS file generated by WordPress as an export of your site. --> | |
| <!-- It contains information about your site's posts, pages, comments, categories, and other content. --> | |
| <!-- You may use this file to transfer that content from one site to another. --> | |
| <!-- This file is not intended to serve as a complete backup of your site. --> | |
| <!-- To import this information into a WordPress site follow these steps: --> | |
| <!-- 1. Log in to that site as an administrator. --> | |
| <!-- 2. Go to Tools: Import in the WordPress admin panel. --> | |
| <!-- 3. Install the "WordPress" importer from the list. --> | |
| <!-- 4. Activate & Run Importer. --> | |
| <!-- 5. Upload this file using the form provided on that page. --> | |
| <!-- 6. You will first be asked to map the authors in this export file to users --> | |
| <!-- on the site. For each author, you may choose to map to an --> | |
| <!-- existing user on the site or to create a new user. --> | |
| <!-- 7. WordPress will then import each of the posts, pages, comments, categories, etc. --> | |
| <!-- contained in this file into your site. --> | |
| <!-- generator="WordPress/6.8.1" created="2025-05-08 09:57" --> | |
| <rss version="2.0" | |
| xmlns:excerpt="http://wordpress.org/export/1.2/excerpt/" | |
| xmlns:content="http://purl.org/rss/1.0/modules/content/" | |
| xmlns:wfw="http://wellformedweb.org/CommentAPI/" | |
| xmlns:dc="http://purl.org/dc/elements/1.1/" | |
| xmlns:wp="http://wordpress.org/export/1.2/" | |
| > | |
| <channel> | |
| <title>co-author-debug</title> | |
| <link>http://co-author-debug.local</link> | |
| <description></description> | |
| <pubDate>Thu, 08 May 2025 09:57:35 +0000</pubDate> | |
| <language>en-US</language> | |
| <wp:wxr_version>1.2</wp:wxr_version> | |
| <wp:base_site_url>http://co-author-debug.local</wp:base_site_url> | |
| <wp:base_blog_url>http://co-author-debug.local</wp:base_blog_url> | |
| <wp:author><wp:author_id>1</wp:author_id><wp:author_login><![CDATA[admin]]></wp:author_login><wp:author_email><![CDATA[dev-email@wpengine.local]]></wp:author_email><wp:author_display_name><![CDATA[admin]]></wp:author_display_name><wp:author_first_name><![CDATA[]]></wp:author_first_name><wp:author_last_name><![CDATA[]]></wp:author_last_name></wp:author> | |
| <wp:category> | |
| <wp:term_id>1</wp:term_id> | |
| <wp:category_nicename><![CDATA[uncategorized]]></wp:category_nicename> | |
| <wp:category_parent><![CDATA[]]></wp:category_parent> | |
| <wp:cat_name><![CDATA[Uncategorized]]></wp:cat_name> | |
| </wp:category> | |
| <wp:term> | |
| <wp:term_id>2</wp:term_id> | |
| <wp:term_taxonomy><![CDATA[author]]></wp:term_taxonomy> | |
| <wp:term_slug><![CDATA[cap-admin]]></wp:term_slug> | |
| <wp:term_parent><![CDATA[]]></wp:term_parent> | |
| <wp:term_name><![CDATA[admin]]></wp:term_name> | |
| <wp:term_description><![CDATA[admin admin 1 dev-email@wpengine.local]]></wp:term_description> | |
| </wp:term> | |
| <generator>https://wordpress.org/?v=6.8.1</generator> | |
| <item> | |
| <title><![CDATA[Test sede]]></title> | |
| <link>http://co-author-debug.local/sedi/test-sede/</link> | |
| <pubDate>Thu, 08 May 2025 07:33:42 +0000</pubDate> | |
| <dc:creator><![CDATA[admin]]></dc:creator> | |
| <guid isPermaLink="false">http://co-author-debug.local/?post_type=sedi&p=8</guid> | |
| <description></description> | |
| <content:encoded><![CDATA[lorem ipsum]]></content:encoded> | |
| <excerpt:encoded><![CDATA[]]></excerpt:encoded> | |
| <wp:post_id>8</wp:post_id> | |
| <wp:post_date><![CDATA[2025-05-08 07:33:42]]></wp:post_date> | |
| <wp:post_date_gmt><![CDATA[2025-05-08 07:33:42]]></wp:post_date_gmt> | |
| <wp:post_modified><![CDATA[2025-05-08 07:33:42]]></wp:post_modified> | |
| <wp:post_modified_gmt><![CDATA[2025-05-08 07:33:42]]></wp:post_modified_gmt> | |
| <wp:comment_status><![CDATA[open]]></wp:comment_status> | |
| <wp:ping_status><![CDATA[closed]]></wp:ping_status> | |
| <wp:post_name><![CDATA[test-sede]]></wp:post_name> | |
| <wp:status><![CDATA[publish]]></wp:status> | |
| <wp:post_parent>0</wp:post_parent> | |
| <wp:menu_order>0</wp:menu_order> | |
| <wp:post_type><![CDATA[sedi]]></wp:post_type> | |
| <wp:post_password><![CDATA[]]></wp:post_password> | |
| <wp:is_sticky>0</wp:is_sticky> | |
| <category domain="author" nicename="cap-admin"><![CDATA[admin]]></category> | |
| <wp:postmeta> | |
| <wp:meta_key><![CDATA[_edit_last]]></wp:meta_key> | |
| <wp:meta_value><![CDATA[1]]></wp:meta_value> | |
| </wp:postmeta> | |
| </item> | |
| <item> | |
| <title><![CDATA[Navigation]]></title> | |
| <link>http://co-author-debug.local/?p=9</link> | |
| <pubDate>Thu, 08 May 2025 07:33:46 +0000</pubDate> | |
| <dc:creator><![CDATA[admin]]></dc:creator> | |
| <guid isPermaLink="false">http://co-author-debug.local/navigation/</guid> | |
| <description></description> | |
| <content:encoded><![CDATA[<!-- wp:page-list /-->]]></content:encoded> | |
| <excerpt:encoded><![CDATA[]]></excerpt:encoded> | |
| <wp:post_id>9</wp:post_id> | |
| <wp:post_date><![CDATA[2025-05-08 07:33:46]]></wp:post_date> | |
| <wp:post_date_gmt><![CDATA[2025-05-08 07:33:46]]></wp:post_date_gmt> | |
| <wp:post_modified><![CDATA[2025-05-08 09:17:09]]></wp:post_modified> | |
| <wp:post_modified_gmt><![CDATA[2025-05-08 09:17:09]]></wp:post_modified_gmt> | |
| <wp:comment_status><![CDATA[closed]]></wp:comment_status> | |
| <wp:ping_status><![CDATA[closed]]></wp:ping_status> | |
| <wp:post_name><![CDATA[navigation__trashed]]></wp:post_name> | |
| <wp:status><![CDATA[trash]]></wp:status> | |
| <wp:post_parent>0</wp:post_parent> | |
| <wp:menu_order>0</wp:menu_order> | |
| <wp:post_type><![CDATA[wp_navigation]]></wp:post_type> | |
| <wp:post_password><![CDATA[]]></wp:post_password> | |
| <wp:is_sticky>0</wp:is_sticky> | |
| <wp:postmeta> | |
| <wp:meta_key><![CDATA[_wp_trash_meta_status]]></wp:meta_key> | |
| <wp:meta_value><![CDATA[publish]]></wp:meta_value> | |
| </wp:postmeta> | |
| <wp:postmeta> | |
| <wp:meta_key><![CDATA[_wp_trash_meta_time]]></wp:meta_key> | |
| <wp:meta_value><![CDATA[1746695829]]></wp:meta_value> | |
| </wp:postmeta> | |
| <wp:postmeta> | |
| <wp:meta_key><![CDATA[_wp_desired_post_slug]]></wp:meta_key> | |
| <wp:meta_value><![CDATA[navigation]]></wp:meta_value> | |
| </wp:postmeta> | |
| </item> | |
| <item> | |
| <title><![CDATA[2nd Test sede]]></title> | |
| <link>http://co-author-debug.local/sedi/2nd-test-sede/</link> | |
| <pubDate>Thu, 08 May 2025 09:15:02 +0000</pubDate> | |
| <dc:creator><![CDATA[admin]]></dc:creator> | |
| <guid isPermaLink="false">http://co-author-debug.local/?post_type=sedi&p=10</guid> | |
| <description></description> | |
| <content:encoded><![CDATA[Lorem 2]]></content:encoded> | |
| <excerpt:encoded><![CDATA[]]></excerpt:encoded> | |
| <wp:post_id>10</wp:post_id> | |
| <wp:post_date><![CDATA[2025-05-08 09:15:02]]></wp:post_date> | |
| <wp:post_date_gmt><![CDATA[2025-05-08 09:15:02]]></wp:post_date_gmt> | |
| <wp:post_modified><![CDATA[2025-05-08 09:15:03]]></wp:post_modified> | |
| <wp:post_modified_gmt><![CDATA[2025-05-08 09:15:03]]></wp:post_modified_gmt> | |
| <wp:comment_status><![CDATA[open]]></wp:comment_status> | |
| <wp:ping_status><![CDATA[closed]]></wp:ping_status> | |
| <wp:post_name><![CDATA[2nd-test-sede]]></wp:post_name> | |
| <wp:status><![CDATA[publish]]></wp:status> | |
| <wp:post_parent>0</wp:post_parent> | |
| <wp:menu_order>0</wp:menu_order> | |
| <wp:post_type><![CDATA[sedi]]></wp:post_type> | |
| <wp:post_password><![CDATA[]]></wp:post_password> | |
| <wp:is_sticky>0</wp:is_sticky> | |
| <category domain="author" nicename="cap-admin"><![CDATA[admin]]></category> | |
| <wp:postmeta> | |
| <wp:meta_key><![CDATA[_edit_last]]></wp:meta_key> | |
| <wp:meta_value><![CDATA[1]]></wp:meta_value> | |
| </wp:postmeta> | |
| </item> | |
| <item> | |
| <title><![CDATA[Custom Styles]]></title> | |
| <link>http://co-author-debug.local/wp-global-styles-twentytwentyfive/</link> | |
| <pubDate>Thu, 08 May 2025 09:15:33 +0000</pubDate> | |
| <dc:creator><![CDATA[admin]]></dc:creator> | |
| <guid isPermaLink="false">http://co-author-debug.local/wp-global-styles-twentytwentyfive/</guid> | |
| <description></description> | |
| <content:encoded><![CDATA[{"version": 3, "isGlobalStylesUserThemeJSON": true }]]></content:encoded> | |
| <excerpt:encoded><![CDATA[]]></excerpt:encoded> | |
| <wp:post_id>11</wp:post_id> | |
| <wp:post_date><![CDATA[2025-05-08 09:15:33]]></wp:post_date> | |
| <wp:post_date_gmt><![CDATA[2025-05-08 09:15:33]]></wp:post_date_gmt> | |
| <wp:post_modified><![CDATA[2025-05-08 09:15:33]]></wp:post_modified> | |
| <wp:post_modified_gmt><![CDATA[2025-05-08 09:15:33]]></wp:post_modified_gmt> | |
| <wp:comment_status><![CDATA[closed]]></wp:comment_status> | |
| <wp:ping_status><![CDATA[closed]]></wp:ping_status> | |
| <wp:post_name><![CDATA[wp-global-styles-twentytwentyfive]]></wp:post_name> | |
| <wp:status><![CDATA[publish]]></wp:status> | |
| <wp:post_parent>0</wp:post_parent> | |
| <wp:menu_order>0</wp:menu_order> | |
| <wp:post_type><![CDATA[wp_global_styles]]></wp:post_type> | |
| <wp:post_password><![CDATA[]]></wp:post_password> | |
| <wp:is_sticky>0</wp:is_sticky> | |
| <category domain="wp_theme" nicename="twentytwentyfive"><![CDATA[twentytwentyfive]]></category> | |
| </item> | |
| <item> | |
| <title><![CDATA[Header menu]]></title> | |
| <link>http://co-author-debug.local/header-menu/</link> | |
| <pubDate>Thu, 08 May 2025 09:19:13 +0000</pubDate> | |
| <dc:creator><![CDATA[admin]]></dc:creator> | |
| <guid isPermaLink="false">http://co-author-debug.local/?p=13</guid> | |
| <description></description> | |
| <content:encoded><![CDATA[<!-- wp:navigation-link {"label":"sedi archive","url":"/sedi","kind":"custom"} /-->]]></content:encoded> | |
| <excerpt:encoded><![CDATA[]]></excerpt:encoded> | |
| <wp:post_id>13</wp:post_id> | |
| <wp:post_date><![CDATA[2025-05-08 09:19:13]]></wp:post_date> | |
| <wp:post_date_gmt><![CDATA[2025-05-08 09:19:13]]></wp:post_date_gmt> | |
| <wp:post_modified><![CDATA[2025-05-08 09:19:13]]></wp:post_modified> | |
| <wp:post_modified_gmt><![CDATA[2025-05-08 09:19:13]]></wp:post_modified_gmt> | |
| <wp:comment_status><![CDATA[closed]]></wp:comment_status> | |
| <wp:ping_status><![CDATA[closed]]></wp:ping_status> | |
| <wp:post_name><![CDATA[header-menu]]></wp:post_name> | |
| <wp:status><![CDATA[publish]]></wp:status> | |
| <wp:post_parent>0</wp:post_parent> | |
| <wp:menu_order>0</wp:menu_order> | |
| <wp:post_type><![CDATA[wp_navigation]]></wp:post_type> | |
| <wp:post_password><![CDATA[]]></wp:post_password> | |
| <wp:is_sticky>0</wp:is_sticky> | |
| </item> | |
| <item> | |
| <title><![CDATA[Header]]></title> | |
| <link>http://co-author-debug.local/header/</link> | |
| <pubDate>Thu, 08 May 2025 09:19:13 +0000</pubDate> | |
| <dc:creator><![CDATA[admin]]></dc:creator> | |
| <guid isPermaLink="false">http://co-author-debug.local/header/</guid> | |
| <description></description> | |
| <content:encoded><![CDATA[<!-- wp:group {"align":"full","layout":{"type":"default"}} --> | |
| <div class="wp-block-group alignfull"><!-- wp:group {"layout":{"type":"constrained"}} --> | |
| <div class="wp-block-group"><!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"top":"var:preset|spacing|30","bottom":"var:preset|spacing|30"}}},"layout":{"type":"flex","flexWrap":"nowrap","justifyContent":"space-between"}} --> | |
| <div class="wp-block-group alignwide" style="padding-top:var(--wp--preset--spacing--30);padding-bottom:var(--wp--preset--spacing--30)"><!-- wp:site-title {"level":0} /--> | |
| <!-- wp:group {"style":{"spacing":{"blockGap":"var:preset|spacing|10"}},"layout":{"type":"flex","flexWrap":"nowrap","justifyContent":"right"}} --> | |
| <div class="wp-block-group"><!-- wp:navigation {"ref":13,"overlayBackgroundColor":"base","overlayTextColor":"contrast","layout":{"type":"flex","justifyContent":"right","flexWrap":"wrap"}} /--></div> | |
| <!-- /wp:group --></div> | |
| <!-- /wp:group --></div> | |
| <!-- /wp:group --></div> | |
| <!-- /wp:group -->]]></content:encoded> | |
| <excerpt:encoded><![CDATA[]]></excerpt:encoded> | |
| <wp:post_id>15</wp:post_id> | |
| <wp:post_date><![CDATA[2025-05-08 09:19:13]]></wp:post_date> | |
| <wp:post_date_gmt><![CDATA[2025-05-08 09:19:13]]></wp:post_date_gmt> | |
| <wp:post_modified><![CDATA[2025-05-08 09:19:13]]></wp:post_modified> | |
| <wp:post_modified_gmt><![CDATA[2025-05-08 09:19:13]]></wp:post_modified_gmt> | |
| <wp:comment_status><![CDATA[closed]]></wp:comment_status> | |
| <wp:ping_status><![CDATA[closed]]></wp:ping_status> | |
| <wp:post_name><![CDATA[header]]></wp:post_name> | |
| <wp:status><![CDATA[publish]]></wp:status> | |
| <wp:post_parent>0</wp:post_parent> | |
| <wp:menu_order>0</wp:menu_order> | |
| <wp:post_type><![CDATA[wp_template_part]]></wp:post_type> | |
| <wp:post_password><![CDATA[]]></wp:post_password> | |
| <wp:is_sticky>0</wp:is_sticky> | |
| <category domain="wp_template_part_area" nicename="header"><![CDATA[header]]></category> | |
| <category domain="wp_theme" nicename="twentytwentyfive"><![CDATA[twentytwentyfive]]></category> | |
| <wp:postmeta> | |
| <wp:meta_key><![CDATA[origin]]></wp:meta_key> | |
| <wp:meta_value><![CDATA[theme]]></wp:meta_value> | |
| </wp:postmeta> | |
| </item> | |
| <item> | |
| <title><![CDATA[How to test]]></title> | |
| <link>http://co-author-debug.local/how-to-test/</link> | |
| <pubDate>Thu, 08 May 2025 09:48:11 +0000</pubDate> | |
| <dc:creator><![CDATA[admin]]></dc:creator> | |
| <guid isPermaLink="false">http://co-author-debug.local/?p=17</guid> | |
| <description></description> | |
| <content:encoded><![CDATA[<!-- wp:paragraph --> | |
| <p>This site has </p> | |
| <!-- /wp:paragraph --> | |
| <!-- wp:list --> | |
| <ul class="wp-block-list"><!-- wp:list-item --> | |
| <li>the Co-Authors Plus plugin enabled</li> | |
| <!-- /wp:list-item --> | |
| <!-- wp:list-item --> | |
| <li>a custom post type named "Sedi" implemented (look in mu-plugins/ folder) with <a href="https://gist.github.com/garubi/bd2db26e3ee9e29829f36d157bf460c0#file-sedi-custom-post-php">this gist</a></li> | |
| <!-- /wp:list-item --> | |
| <!-- wp:list-item --> | |
| <li>the filter 'coauthors_supported_post_types' implemented to restrict the Co-Authors Plus functionalities to the "Sedi" post type (look in mu-plugins/folder and <a href="https://gist.github.com/garubi/bd2db26e3ee9e29829f36d157bf460c0/raw/97f445e3ab71d0a7fd7ba7c37232062864f3494e/co-authors-plus-filters.php" data-type="link" data-id="https://gist.github.com/garubi/bd2db26e3ee9e29829f36d157bf460c0/raw/97f445e3ab71d0a7fd7ba7c37232062864f3494e/co-authors-plus-filters.php">this gist</a> ) </li> | |
| <!-- /wp:list-item --></ul> | |
| <!-- /wp:list --> | |
| <!-- wp:paragraph --> | |
| <p>Look at the debug_log (or within Playground in the console log): you'll see a number of warning due to unset object properties.</p> | |
| <!-- /wp:paragraph --> | |
| <!-- wp:paragraph --> | |
| <p>If you remove the 'coauthors_supported_post_types' filter the warnings go away.</p> | |
| <!-- /wp:paragraph --> | |
| <!-- wp:paragraph --> | |
| <p><em>(You could also see the "Sedi" posts going to the <a href="/sedi">Sedi archive</a>, but it is ininfluent: you get the warnings on any page of the site)</em></p> | |
| <!-- /wp:paragraph --> | |
| <!-- wp:paragraph --> | |
| <p></p> | |
| <!-- /wp:paragraph -->]]></content:encoded> | |
| <excerpt:encoded><![CDATA[]]></excerpt:encoded> | |
| <wp:post_id>17</wp:post_id> | |
| <wp:post_date><![CDATA[2025-05-08 09:48:11]]></wp:post_date> | |
| <wp:post_date_gmt><![CDATA[2025-05-08 09:48:11]]></wp:post_date_gmt> | |
| <wp:post_modified><![CDATA[2025-05-08 09:54:43]]></wp:post_modified> | |
| <wp:post_modified_gmt><![CDATA[2025-05-08 09:54:43]]></wp:post_modified_gmt> | |
| <wp:comment_status><![CDATA[open]]></wp:comment_status> | |
| <wp:ping_status><![CDATA[open]]></wp:ping_status> | |
| <wp:post_name><![CDATA[how-to-test]]></wp:post_name> | |
| <wp:status><![CDATA[publish]]></wp:status> | |
| <wp:post_parent>0</wp:post_parent> | |
| <wp:menu_order>0</wp:menu_order> | |
| <wp:post_type><![CDATA[post]]></wp:post_type> | |
| <wp:post_password><![CDATA[]]></wp:post_password> | |
| <wp:is_sticky>0</wp:is_sticky> | |
| <category domain="category" nicename="uncategorized"><![CDATA[Uncategorized]]></category> | |
| </item> | |
| </channel> | |
| </rss> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment