• Resolved jcarrest

    (@jcarrest)


    I create new posts in the forum, duplicating the wordpress entry correctly.

    But how can I collect a custom field, so that my modules load correctly?

    In my input the function picks it up like this:

    $idcamp = get_post_meta(get_the_ID(), ‘id_campeonato’, true);

    Of course, when I duplicate creating a post, it doesn’t exist. Any glorious ideas?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter jcarrest

    (@jcarrest)

    It’s a bit strange, but I got it working like this:

    function bannerinfogp(){
    $idgp = get_post_meta(
    get_the_ID(), ‘id_carrera’, true);
    if (empty($idgp)){
    $topic_title = bbp_get_topic_title();
    $entry = get_page_by_title( $topic_title, OBJECT, ‘post’ );
    if ( $entry ) {
    $custom_field = get_post_meta( $entry->ID, ‘id_carrera’, true );
    $idgp = $custom_field;
    }

    It breaks me down a bit this way. It would be better if it doubled the custom field.

    It would be more appropriate.

    Plugin Author Nick

    (@nickchomey)

    Im not sure what you’re asking for.

    Do you want help with your custom code or are you requesting a change to this plugin’s code?

    Either way, im not really sure what the problem is/what you’re trying to achieve.

    Thread Starter jcarrest

    (@jcarrest)

    Have the plugin add the post custom fields to the post it creates on the forum. I don’t know if it would be possible. I fixed it with my custom code, but it would be much easier if it was already implemented in the plugin.

    Plugin Author Nick

    (@nickchomey)

    To clarify, what you would like is when a new post is created, if that post has any postmeta custom fields, those custom fields will be duplicated for the forum topic that is created for the comments?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Duplicate with custom fields’ is closed to new replies.