Save something to global var in add_filter

I ran a test and the following works: global $testMe; $testMe = 0; function my_acf_update_value( $value, $post_id, $field ) { global $testMe; $testMe = $value; return $value; } add_filter(‘acf/update_value/key=field_5308e5e79784b’, ‘my_acf_update_value’, 10, 3); // Test: Apply the filter apply_filters(‘acf/update_value/key=field_5308e5e79784b’,’a’,’b’,’c’); // end Test echo $testMe; // prints ‘a’ So, in principle, your code is functional. There are … Read more

Setting a custom $query->query_vars[‘meta_key’] breaks the WordPress menu

I was having the exact same problem on an archive page of a custom post type with a needless extra query; for pagination reasons. Searching for the same solution I found this post on Stack Overflow https://stackoverflow.com/questions/21303743/new-wp-query-or-pre-get-posts-to-view-all-posts-for-custom-post-type I had a play and added this line of code into the function. if( ! $query->is_post_type_archive()) return; So … Read more

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