Skip Navigation

[Resuelto] global function for empty fields

This support ticket is created hace 5 años, 11 meses. 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.

Hoy no hay técnicos de soporte disponibles en el foro Juego de herramientas. Siéntase libre de enviar sus tiques y les daremos trámite tan pronto como estemos disponibles en línea. Gracias por su comprensión.

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)

Etiquetado: 

Este tema contiene 3 respuestas, tiene 2 mensajes.

Última actualización por Akhil hace 5 años, 10 meses.

Asistido por: Waqar.

Autor
Mensajes
#1174934

Hi waqar, good day. Happy new year!

I have this idea to create a global function to replace all the empty fields with an "update" button,
I am currently using shortcode "update-button" for this purpose, it works just that I need to edit "all" all my templates codes to add this,

is there anything can be done? this could be useful as the main toolset settings option too.

#1174935

something like this?

<?php 
  
    if (!empty($wpcf)) {
?>
        <div class="update">update </div>
<?php
    }
?>
#1175126

Hi Dee,

Thanks for asking and I wish you a wonderful new year ahead.

Due to a variation in field types, content items, and project requirements etc, bulk editing is something that is left for website admins to implement, on a case to case basis.

But we always welcome and encourage new feature requests and you can submit this directly to the product management team, through the form at:
https://toolset.com/home/contact-us/suggest-a-new-feature-for-toolset/

To create a custom code or shortcode that can update/add custom field values in bulk, you can use "get_posts" function ( ref: https://codex.wordpress.org/Template_Tags/get_posts ) to cycle through your desired post types and then use "get_post_custom" function ( ref: https://codex.wordpress.org/Function_Reference/get_post_custom ) to cycle through all the custom field values attached to individual post.

To perform the update operation on an empty custom field value you can use "update_post_meta" function ( ref: https://codex.wordpress.org/Function_Reference/update_post_meta ).

I hope this helps!

regards,
Waqar

#1177428

My issue is resolved now. Thank you!