[Gelöst] CRED – how to update other standard WordPress Fields
This support ticket is created vor 5 Jahre, 3 Monate. There's a good chance that you are reading advice that it now obsolete.
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.
Next, you can add the following code, in the active theme's "functions.php" file:
add_action('cred_save_data', 'my_menu_order_action',10,2);
function my_menu_order_action($post_id, $form_data)
{
// if a specific form
if ($form_data['id']==123)
{
if (isset($_POST['menu-oder']))
{
$my_post = array(
'ID' => $post_id,
'menu_order' => $_POST['menu-oder'],
);
// Update the post into the database
wp_update_post( $my_post );
}
}
}
Note: Please replace "123" with the actual CRED form's ID, that you'd like to target for this action.