在弹出窗口中显示WP作业管理器自定义字段



我正在使用WP作业管理器插件来允许在我的网站上提交工作申请。插件开发人员遵循官方文档,我使用此功能创建自定义电话字段:

// Add field to admin
add_filter( 'resume_manager_resume_fields', 'wpjms_admin_resume_form_fields' 
);
function wpjms_admin_resume_form_fields( $fields ) {
$fields['_candidate_color'] = array(
'label'         => __( 'Phone', 'job_manager' ),
'type'          => 'text',
'placeholder'   => __( 'Enter your phone', 'job_manager' ),
'description'   => '',
'priority' => 1
);
return $fields;
}
// Add field to frontend
add_filter( 'submit_resume_form_fields', 'wpjms_frontend_resume_form_fields' 
);
function wpjms_frontend_resume_form_fields( $fields ) {
$fields['resume_fields']['phone'] = array(
'label' => __( 'Phone', 'job_manager' ),
'type' => 'text',
'required' => true,
'placeholder' => '',
'priority' => 1
);
return $fields;
}
// Add a line to the notifcation email with custom field
add_filter( 'apply_with_resume_email_message', 
'wpjms_color_field_email_message', 10, 2 );
function wpjms_color_field_email_message( $message, $resume_id ) {
$message[] = "n" . "Phone: " . get_post_meta( $resume_id, '_phone', true );  
return $message;
}

我试图在这里显示为 ex 的绿色联系人弹出按钮,但似乎它没有显示任何内容,使用一些开发人员建议的这段代码:

<?php echo get_post_meta( $post->ID, '_phone', true ); ?>

我试图使用相同的代码显示在绿色弹出窗口中,但它不起作用。手机将插入该应用程序的管理区域,并在检查时显示。这是弹出区域的外观:

<div class="resume_contact">
<a href="#resume-dialog" class="small-dialog popup-with-zoom-anim button"><i class="fa fa-envelope"></i> <?php esc_html_e( 'Contact', 'workscout' ); ?></a>
<div id="resume-dialog" class="small-dialog zoom-anim-dialog mfp-hide apply-popup">
<div class="small-dialog-headline">
<h2><?php esc_html_e('Send Message','workscout'); ?></h2>
</div>
<div class="small-dialog-content">
<!--<?php do_action( 'resume_manager_contact_details' ); ?>--> // Need to show phone content here !
</div>
</div>
</div>

嘿嘿帮忙这里怎么显示?

修复了自己:)

问题出在这一部分:

add_filter( 'resume_manager_resume_fields', 'wpjms_admin_resume_form_fields' 
);
function wpjms_admin_resume_form_fields( $fields ) {
$fields['_candidate_color'] = array(  // Here i didnt renamed field to _phone  lol :D
'label'         => __( 'Phone', 'job_manager' ),
'type'          => 'text',
'placeholder'   => __( 'Enter your phone', 'job_manager' ),
'description'   => '',
'priority' => 1
);
return $fields;
}

现在工作正常。感谢任何人的帮助。

最新更新