Closed Li-An closed 4 years ago
Rejected how?
Do you have any server error logs? Do you have any plugins that add custom post types?
Yes, I created a little plugin to manage one custom post type.
And rejected saying that the email address does not exist.
Would it be possible to see the custom post type plugin? I suspect something in that might be triggering an error, and it will help to reproduce it.
Here is the code
<?php
/**
* Plugin Name: ECHO Maison Codes Snippet Plugin
* Plugin URI: http://www.li-an.fr/blog/
* Description: Gestion des bouts de code utiles
* Version: 1.0
* Author: Li-An
* Author URI: http://www.li-an.fr/blog/
*/
add_action('init', 'my_custom_init');
function my_custom_init()
{
/* notre code PHP pour rajouter les custom post type */
register_post_type(
'code',
array(
'label' => 'Codes',
'labels' => array(
'name' => 'Codes',
'singular_name' => 'Code',
'all_items' => 'Tous les codes',
'add_new_item' => 'Ajouter un code',
'edit_item' => 'Éditer un code',
'new_item' => 'Nouveau code',
'view_item' => 'Voir code',
'search_items' => 'Rechercher parmi les codes',
'not_found' => 'Pas un code trouvé',
'rewrite' => array("slug" => "codes"),
'query_var' => "codes", // This goes to the WP_Query schema
'not_found_in_trash'=> 'Pas un code dans la corbeille'
),
'public' => true,
'capability_type' => 'post',
'supports' => array(
'title',
'editor',
'thumbnail' ,
'excerpt',
'wpcom-markdown',
),
'has_archive' => true
)
);
register_taxonomy(
'utilisation',
'code',
array(
'label' => 'Utilisation',
'labels' => array(
'name' => 'Utilisations',
'singular_name' => 'Utilisation',
'all_items' => 'Toustes les utilisations',
'edit_item' => 'Éditer l’utilisation',
'view_item' => 'Voir l’utilisation',
'update_item' => 'Mettre à jour l’utilisation',
'add_new_item' => 'Ajouter une utilisation',
'new_item_name' => 'Nouvelle utilisation',
'search_items' => 'Rechercher parmi les utilisations',
'popular_items' => 'utilisations les plus utilisés'
),
'hierarchical' => false
)
);
register_taxonomy_for_object_type( 'utilisation', 'code' );
}
function my_cptui_change_posts_per_page( $query ) {
if ( is_admin() || ! $query->is_main_query() ) {
return;
}
if ( is_post_type_archive( 'code' ) ) {
$query->set( 'posts_per_page', 30 );
}
}
add_filter( 'pre_get_posts', 'my_cptui_change_posts_per_page' );
I forget to tell I use https://fr.wordpress.org/plugins/wp-downloadmanager/ (so custom post types here too).
Thanks! I'll try it out
Sorry, I did not try the basic test : desactivating other plugins. It works "correctly" in this case. So I have to check witch extension is interfering. But I have another problem. I open a new ticket.
Hello, error is showing when I try a search on Every Post Types. It does not show if the search is only on Posts. (send error by email is rejected by the way).