• Resolved fbgraphiklab

    (@fbgraphiklab)


    Hello,
    I want to display the author’s name in the body of the notification email.
    It works well for posts and pages but not for custom post types.
    I use the {author_display} tag.
    I also tried with {author_email} but that doesn’t work either.

    Can you please fix this bug?
    Or is it a premium feature?
    Thanks

Viewing 9 replies - 1 through 9 (of 9 total)
  • Hey @fbgraphiklab,

    Thanks for reaching out!

    When you have sometime, can you please share the steps I can follow to replicate the issue and the custom post types you’re using so I can take a look?

    Kindly,

    Thread Starter fbgraphiklab

    (@fbgraphiklab)

    Hello,
    thank you for your answer.
    I have created real estate listings as a custom post type, with a form visible on all pages of the site. I put you the code below (you can see that I activated the support of authors).
    In WPForms, I activated a notification that sends the content of the form {all_fields} as well as the name of the page and its url {page_title} {page_url}. I would also like to have the author’s name {author_display}. The variables are correctly sent when the form is sent from a page or an article but not from a custom post type page. The author field is empty.
    Is this clear enough or do you need more details?
    (In this case, please tell me what you need)

    wpforms screenshot

    <?php
    function cptui_register_my_cpts() {
    	$labels = [
    		"name" => __( "Annonces", "hello-elementor-child" ),
    		"singular_name" => __( "Annonce", "hello-elementor-child" ),
    		"menu_name" => __( "Annonces", "hello-elementor-child" ),
    		"all_items" => __( "Toutes les annonces", "hello-elementor-child" ),
    		"add_new" => __( "Ajouter une annonce", "hello-elementor-child" ),
    		"add_new_item" => __( "Ajouter une nouvelle annonce", "hello-elementor-child" ),
    		"edit_item" => __( "Modifier annonce", "hello-elementor-child" ),
    		"new_item" => __( "Nouvelle annonce", "hello-elementor-child" ),
    		"view_item" => __( "Voir annonce", "hello-elementor-child" ),
    		"view_items" => __( "Voir annonces", "hello-elementor-child" ),
    		"search_items" => __( "Rechercher des annonces", "hello-elementor-child" ),
    		"not_found" => __( "Aucune annonce trouvée", "hello-elementor-child" ),
    		"not_found_in_trash" => __( "Aucun annonce trouvée dans la corbeille", "hello-elementor-child" ),
    		"parent" => __( "Annonce parent :", "hello-elementor-child" ),
    		"featured_image" => __( "Image mise en avant pour cette annonce", "hello-elementor-child" ),
    		"set_featured_image" => __( "Définir l’image mise en avant pour cette annonce", "hello-elementor-child" ),
    		"remove_featured_image" => __( "Retirer l’image mise en avant pour cette annonce", "hello-elementor-child" ),
    		"use_featured_image" => __( "Utiliser comme image mise en avant pour cette annonce", "hello-elementor-child" ),
    		"archives" => __( "Archives des annonces", "hello-elementor-child" ),
    		"insert_into_item" => __( "Insérer dans l'annonce", "hello-elementor-child" ),
    		"uploaded_to_this_item" => __( "Téléverser sur l'annonce", "hello-elementor-child" ),
    		"filter_items_list" => __( "Filtrer la liste des annonces", "hello-elementor-child" ),
    		"items_list_navigation" => __( "Navigation de liste des annonces", "hello-elementor-child" ),
    		"items_list" => __( "Liste des annonces", "hello-elementor-child" ),
    		"attributes" => __( "Attributs des annonces", "hello-elementor-child" ),
    		"name_admin_bar" => __( "Annonce", "hello-elementor-child" ),
    		"item_published" => __( "Annonce publiée", "hello-elementor-child" ),
    		"item_published_privately" => __( "Annonce publiée en privé.", "hello-elementor-child" ),
    		"item_reverted_to_draft" => __( "Annonce repassée en brouillon.", "hello-elementor-child" ),
    		"item_scheduled" => __( "Annonce planifiée", "hello-elementor-child" ),
    		"item_updated" => __( "Annonce mise à jour.", "hello-elementor-child" ),
    		"parent_item_colon" => __( "Annonce parent :", "hello-elementor-child" ),
    	];
    	$args = [
    		"label" => __( "Annonces", "hello-elementor-child" ),
    		"labels" => $labels,
    		"description" => "",
    		"public" => true,
    		"publicly_queryable" => true,
    		"show_ui" => true,
    		"show_in_rest" => true,
    		"rest_base" => "",
    		"rest_controller_class" => "WP_REST_Posts_Controller",
    		"rest_namespace" => "wp/v2",
    		"has_archive" => false,
    		"show_in_menu" => true,
    		"show_in_nav_menus" => true,
    		"delete_with_user" => false,
    		"exclude_from_search" => false,
    		"capability_type" => "post",
    		"map_meta_cap" => true,
    		"hierarchical" => false,
    		"can_export" => true,
    		"rewrite" => [ "slug" => "annonce", "with_front" => true ],
    		"query_var" => true,
    		"menu_icon" => "dashicons-store",
    		"supports" => [ "title", "editor", "author" ],
    		"show_in_graphql" => false,
    	];
    	register_post_type( "annonce", $args );
    }
    add_action( 'init', 'cptui_register_my_cpts' );
    

    Hey @fbgraphiklab – Thanks for sharing the details!

    Looking at the code and details you’ve shared, I apologize as customizations like this are outside of our scope for support. In case you’d like to look into custom development options, we highly recommend using Codeable.

    Thanks!

    Thread Starter fbgraphiklab

    (@fbgraphiklab)

    I should not have sent the code for the custom post types.
    I don’t ask you to modify the code, it was just an example to show you that I created a custom post type WITH author support, but that in WPForms, it is impossible to use the {author_display} variable in the notification email.
    I’m not trying to customize WPForms, but just to use it in a normal way.

    The problem is that there is a BUG WITH THE {author_display} TAG.
    Please fix this bug and take the time to read the questions correctly.

    Thank you.

    Hey @fbgraphiklab – Thanks for following on this ticket and I sincerely apologize for the confusion!

    Let me do some testing, and I’ll let you know with my findings around {author_display} smart tag.

    Kindly,

    Hey @fbgraphiklab – Thanks for your patience!

    I thought to give you an update that I’ve shared this with the team, and we will be looking into this for the author smart tag. In the meantime, if you have any other questions about WPForms, please feel free to reach out.

    Kindly,

    Thread Starter fbgraphiklab

    (@fbgraphiklab)

    Thanks Prashant.
    I hope that the team will fix this bug soon.

    Hey @fbgraphiklab,

    Sure – in the meantime, if you have any questions, please feel free to reachout.

    Kindly,

    Hey @fbgraphiklab – We haven’t heard back from you in about a week, so I’m going to go ahead and close this thread for now. But if you’d like us to assist further, please feel welcome to continue the conversation.

    Thanks!

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Author smart tags and custom post types’ is closed to new replies.