Skip Navigation

[Résolu] CRED – how to update other standard WordPress Fields

This support ticket is created Il y a 4 années et 5 mois. 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.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 2 réponses, has 2 voix.

Last updated by tony Il y a 4 années et 5 mois.

Assigned support staff: Waqar.


When generating a CRED form you have the option to create/edit Post Title and Featured Image only. I want to edit the Post Menu order.

Please can you advise how this can be achieved?

Many thanks.



Languages: Anglais (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi Tony,

Thank you for contacting us and I'll be happy to assist.

To add or update the post's "Menu Order", through a CRED form, you can use "cred_save_data" hook ( ref: ), with the "wp_update_post" function ( ref: ).

You'll first add a generic field for the menu order value in the form:

<div class="form-group">
<label>Menu Order</label>
[cred_generic_field type='integer' field='menu-oder']

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.

I hope this helps.



Hi Waqar

My issue is resolved now. Thank you!

It all worked fine. For future reference I used the above solution on an EDIT form and changed the line:


Now I can use this field as a secondary sort in a View and allow my users to maintain the menu-order values.

Many thanks