Hi,
Yes it’s possible to add custom field using the action hook cmb2_after_form Here is a sample code on how you can add fields under the redirections form.
add_action( 'cmb2_after_form', function ( $cmb_id ) {
// Check if this form is for redirections
if ( $cmb_id == 'rank-math-redirections' ) {
// Add your custom field here
}
} );
To save the custom field data you need to use this action hook admin_post_rank_math_save_redirections. Here is a code sample
add_action( 'admin_post_rank_math_save_redirections', function () {
// Save data from $_POST
} );
To store the custom data you might need to use another table or a new custom table.
Please let me know if you have any more questions regarding this. Looking forward to helping you.
Thank you
Thanks you so much Jaed.
This is just I looking for!
Hello,
We are super happy that we have addressed your concern. If you have any other questions in the future, know that we are here to help you.
If you don’t mind us asking, could you please leave us a review (if you haven’t already) on https://wordpress.org/support/plugin/seo-by-rank-math/reviews/#new-post about your overall experience with Rank Math? We appreciate your time and patience.
If you have another question in the future, please feel free to create a new forum topic, and it will be our pleasure to assist you again.
Thank you.