Help using acf/save_post hook to connect to Untappd API and update_field [closed]

It’s because your require_once ‘Pintlabs/Service/Untappd.php’; is relative to “current” file and should be absolute path. I don’t know where are you using this hook but depending on location it should look something like this: ABSPATH is your wordpress root dir and ‘custom-path’ should be a path to Pintlabs dir require_once ABSPATH.’custom-path/’.’Pintlabs/Service/Untappd.php’; get_template_directory() if you use … Read more

Save post in another table

The original post_date is saved post_date and post_date_gmt. And modification dates are saved on post_modified_date and post_modified_date_gmt. So you never lose your original creation date.

Updating user meta on save post

You could query all the authors and loop through to update their dates. The below query pulls all users who have a programme_id of the current post_id and allocates an array of their IDs. You can then loop through to update whatever is necessary: /** Save Custom Metaboxes **/ function save_custom_meta_boxes( $post_id, $post ) { … Read more

save_post not triggered when a post is updated

A var_dump() in save_post action doesn’t display any information on the screen. Well, it does only when you are on “Add new” screen. This is due the different sequence of actions that follow when creating a new post or when editing it. When you click on “publish” or “update” button, there is a request, the … Read more

Stripping URLs & Email from post submissions

You can use the_content (Click here for more info) hook to change the content while rendering the post/page. This will be triggered when Post is being read from Database. So post content will not be changed in database but only filtered while rendering. add_filter( ‘the_content’, ‘remove_email_and_url_from_post’ ); function remove_email_and_url_from_post( $content ) { // Check if … Read more

Dynamically set taxonomy term and show admin notice on post save

Okay, so just in case anyone needs help on the same thing I did… here is my solution. Instead of a php/wordpress solution, I used javascript. Id love to see the php/wordpress solution if someone wants to post it. <?php // Admin Custom JS add_action(‘admin_head’, ‘admin_custom_js’); function admin_custom_js() { ?> <script> // update date (month) … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)