• You MUST read the Babiato Rules before making your first post otherwise you may get permanent warning points or a permanent Ban.

    Our resources on Babiato Forum are CLEAN and SAFE. So you can use them for development and testing purposes. If your are on Windows and have an antivirus that alerts you about a possible infection: Know it's a false positive because all scripts are double checked by our experts. We advise you to add Babiato to trusted sites/sources or disable your antivirus momentarily while downloading a resource. "Enjoy your presence on Babiato"

[help] PHP WordPress Question

MinMary

Active member
Trusted Uploader
Sep 22, 2019
153
69
28
I am using Astra Pro Custom layouts. I have created a hook that only executes my code in specific post types. All PHP code in there works except for this except when I place it in functions.php

Does anyone know how to run this from the plugin?

Code:
add_action('admin_head', 'populating_your_custom_field');
add_action('wp_head', 'populating_your_custom_field');

function populating_your_custom_field(){
  $your_custom_field_value = the_field("field_607aa2cb60022");

  if (empty($your_custom_field_value)) {
    $your_custom_field_value = "Random text for testing";
    update_field("field_607aa2cb60022", $your_custom_field_value);
  }
}

Thanks
 
Last edited:
I am using Astra Custom layouts. I have created a hook that only executes my code in specific post types. All PHP code in there works except for this except when I place it in functions.php

Does anyone know how to run this from the plugin?

Code:
add_action('admin_head', 'populating_your_custom_field');
add_action('wp_head', 'populating_your_custom_field');

function populating_your_custom_field(){
  $your_custom_field_value = the_field("field_607aa2cb60022");

  if (empty($your_custom_field_value)) {
    $your_custom_field_value = "Random text for testing";
    update_field("field_607aa2cb60022", $your_custom_field_value);
  }
}

Thanks
its not a correct sub-forum to post your query! moving your post.
 
Op. You should ask this in Astra Community at WordPress org!
 
@sidasu20 How can you expect me to request support for a nulled plugin?
No, Astra community in WP org is free, you just need reg an account at WP org. Astra' users or supporters can give you ideas to solve your problems, and if you need high level support, pay for it.
Really, I and many members here can help you but I guess you must wait for days. Check code and help others to solve their problems asap not still my passion anymore.
Gluck!
 
Looks like you're new to WP. I am using the PRO version of Astra for goodness sake. The PRO version has a custom layout functionality which is not available for free. So when you require me to ask for support for premium functionality, clearly you're out of reach. I appreciate the response though it's wrong. WP Community is free for free plugins in WP Plugins repository. If you are using a premium plugin, you have to request support from the author premium support. :rolleyes:
 
  • Like
Reactions: sidasu
Looks like you're new to WP. I am using the PRO version of Astra for goodness sake. The PRO version has a custom layout functionality which is not available for free. So when you require me to ask for support for premium functionality, clearly you're out of reach. I appreciate the response though it's wrong. WP Community is free for free plugins in WP Plugins repository. If you are using a premium plugin, you have to request support from the author premium support. :rolleyes:
I'm PHP and WP dev over ten years, not newbie. Really you can ask advanced problems on community at WP org, they just not support if you ask they give the answer asap or must login your website to find & solve your problems, not only supporters of product can help you, many advanced users also help you solve your problems easily!
I did take years to help others solve their advanced problems at WP org and StackOverflow before, but from I move my career from freelance to my own agency, I lost my passion to do it then!
Good luck!
 
Really you can ask advanced problems on community at WP org, they just not support if you ask they give the answer asap or must login your website to find & solve your problems, not only supporters of product can help you, many advanced users also help you solve your problems easily!
Not true, if you ask questions about PRO products, the thread will be quickly blocked by a moderator, as that is not allowed.

Anyway, in answer to OP: you have 2 actions with the same name, only with different hooks. That's not going to work, add only 1 action to the function.
 
Not true, if you ask questions about PRO products, the thread will be quickly blocked by a moderator, as that is not allowed.

Anyway, in answer to OP: you have 2 actions with the same name, only with different hooks. That's not going to work, add only 1 action to the function.
Thanks for the answer and indeed the clarification!
 
AdBlock Detected

We get it, advertisements are annoying!

However in order to keep our huge array of resources free of charge we need to generate income from ads so to use the site you will need to turn off your adblocker.

If you'd like to have an ad free experience you can become a Babiato Lover by donating as little as $5 per month. Click on the Donate menu tab for more info.

I've Disabled AdBlock