SSL certificate for the host could not be verified

I wouldn’t recommend disabling ssl verification – that leaves your system vulnerable to potential man in the middle attacks as explained in this SO post. Also, your use of sslv3 is most likely causing this issue now SPECIFICALLY because Authorize.net identified it as vulnerable to the POODLE compromise. Since that happened, many vendors removed the … Read more

AJAX filter posts on click based on category

This line in functions.php is your problem: $cat_id = get_post_meta($_REQUEST[‘cat’]); I think you are misunderstanding the purpose of the get_post_meta() function. It is designed to get metadata for a WordPress Post, not data from a POST request to the site. The first parameter of the get_post_meta() function is the $post_id, but since you are passing … Read more

Is it possible to remove the filter from 4.8 text widget?

We now have a new filter widget_text_content introduced in 4.8 src, with the following default callbacks: add_filter( ‘widget_text_content’, ‘capital_P_dangit’, 11 ); add_filter( ‘widget_text_content’, ‘wptexturize’ ); add_filter( ‘widget_text_content’, ‘convert_smilies’, 20 ); add_filter( ‘widget_text_content’, ‘wpautop’ ); that are applied if the filter settings, for the widget instance, is set to ‘content’. When you remove the filter settings … Read more

Keep Users Logged In As Long As I Like

What you found is actually perfectly accurate. With WP’s commitment to backwards compatibility it’s not that common for thing to stop working. This filter is used in wp_set_auth_cookie() to calculate the duration. Resulting value is used in PHP’s setcookie(). There is no mention of specifics limits in documentation, so in practice the value is limited … Read more

add_filter for specific pages

It is helpful to post your entire filter and callback code, rather than just pieces. But, I suspect that the problem is that you’re not returning $the_content outside of your conditional, e.g.: function magicalendar_get_event_page( $content ) { if ( $post->post_name == ‘magicalendarpage’ ) { // Do something to $content return $content; } } add_filter( ‘the_content’, … Read more

Adding a class to the body_class function

Actually you just need a callback for the body_class filter. Then simply check what correlation you got between your meta data and the actual value: If it is a 1:1 correlation, you can just add the result of get_field() as new body class. Example: array( get_field( ‘mem_id’ ) ) if the mem_id meta value would … Read more

Change upload directory on custom plugin page

After working on this for a bit and checking the GLOBALS variable for anything useful, it looks like the referring URL inside of the media modal is the same URL as my custom plugin page. Using that and splitting it up a bit I was able to confirm that I am on the approrpriate page. … Read more

Filter Widget Title Wrap

The filter to do this is dynamic_sidebar_params also see this tutorial on this filter at ACF’s site (even if you don’t use ACF). function prefix_filter_widget_title_tag( $params ) { $params[0][‘before_title’] = ‘<h2 class=”widget-title widgettitle”>’ ; $params[0][‘after_title’] = ‘</h2>’ ; return $params; } add_filter( ‘dynamic_sidebar_params’ , ‘prefix_filter_widget_title_tag’ );

Filtered query_vars becomes global. Why does this work?

Within the WP::parse_request() method (src) we locate the query_vars filter: $this->public_query_vars = apply_filters( ‘query_vars’, $this->public_query_vars ); and within WP::register_globals() we can see why it becomes globally accessible (src): // Extract updated query vars back into global namespace. foreach ( (array) $wp_query->query_vars as $key => $value ) { $GLOBALS[ $key ] = $value; } where the … Read more

Translating an error message

The gettext filter can be used to change strings that use the gettext functions. add_filter( ‘gettext’, ‘wpse_change_error_string’, 10, 3 ); /** * Translate text. * * @param string $translation Translated text. * @param string $text Text to translate. * @param string $domain Text domain. Unique identifier for retrieving translated strings. * * @return string */ … Read more