Support

Account

Home Forums General Issues Echo a variable in a custom field?

Solving

Echo a variable in a custom field?

  • Hi, it’s possible to echo a variable in a custom field?

    Let me explain

    I’ve installed a download-counter plugin on WordPress and with a simple php code i can show on my site how many downloads has obtained every item

    That’s all ok..
    The problem starts when i don’t want to show the result in my webpage but in my iOS app. For the app i use REST API and That download plugin doesn’t have an API so i can’t call/show the downloads number BUT… your plugin is supported by REST API. This means that i can show a custom field “content” in my app

    So, I need to put the downloads number in a custom field then show the custom field in the app

    there is a way to put the result from the downloads plugin in a custom field that i could name “afc_downloads”?

    Something like:

    $N_Downloads = echo the number for a defined item

    N_Downloads == the_field(afc_downloads)

    (To store the number in a custom field)

    Is that totally wrong? 😅😂

  • Perhaps update_field() will be something for you?

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.