Skip Navigation

[Gelöst] global function for empty fields

This support ticket is created vor 5 Jahre, 4 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.

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 3 Antworten, has 2 Stimmen.

Last updated by Akhil vor 5 Jahre, 3 Monate.

Assisted by: Waqar.

Author
Artikel
#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

Waqar
Supporter

Languages: Englisch (English )

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

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!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.