What’s the best action to use when you want to do something only once per theme setup?

I’m writing a theme which has it’s own set of database tables. I’m wondering what is the best action for me to use when I want my install function to be invoked only once when the theme is activated for the first time? I know there is a setup_theme action, but not sure if that’s … Read more

Custom post_type search’s $wp_query->query_vars do not correspond

I have been having this issue, with integrating events manager among my other post types, where the other custom post types show up in the $wp_query->query_vars array, except for the event manager ones. The search works, and does grab the event post types, but for some strange reason the post_type query variable does not include … Read more

wp_get_attachment_metadata returns false with add_action() ‘add_attachment’ hook

With the following code in functions.php – wp_get_attachment_metadata() returns false and or empty. Perhaps I am attempting to use wp_get_attachment_metadata() before it’s ready? As some tests have shown when manually add a previously added $attachement_ID I get the desired information.. function my_custom_attachment($attachment_ID) { $meta = wp_get_attachment_metadata($attachment_id); // returns false } add_action(‘add_attachment’, ‘my_custom_attachment’); 1 Answer 1 … Read more

Empty Super Cache programmatically (with ACF action) [closed]

Closed. This question is off-topic. It is not currently accepting answers. Your question should be specific to WordPress. Generic PHP/JS/HTML/CSS questions might be better asked at Stack Overflow or another appropriate site of the Stack Exchange network. Third party plugins and themes are off topic. Closed 7 years ago. Improve this question I regularly use … Read more