don’t call ajax if not plugin page

You can check for WordPress’s DOING_AJAX constant: if ( defined( ‘DOING_AJAX’ ) && DOING_AJAX ) { return; } …or use the related wp_doing_ajax() function: if ( wp_doing_ajax() ) { return; } However, I’d also double-check to make sure that App\Bootstrap has a method named process_moviewp_like as well, because that error doesn’t look like something that … Read more

How to remove index meta tag

Rather than using the add_action( ‘wp_head’, ‘wp_no_robots’, 1 ); Try using add_filter( ‘wp_robots’, ‘wp_robots_no_robots’ ); In your code you are actually trying to add one more function call to pre called function rather than just changing its value to noindex. Use add_filter instead. 🙂

PHP Warning: Declaration of aec_contributor_list::form() should be compatible with WP_Widget::form($instance)

WP_Widget::form() expects to receive an array as a parameter, but the plugin’s form() function doesn’t have it. You can probably fix it like this: /** @see WP_Widget::form */ function form ( $instance ) { _e(‘No options available.’, AEC_NAME); } Be aware, though, that if the plugin’s not supported by its developers anymore, there won’t be … Read more

Content-Security-Policy Headers are there and showing the correct settings, but still getting a refused connection

After tons of digging it appears that the way the error message is worded was a bit misleading. Refused to load https://www.service-domain.com/ because it does not appear in the frame-ancestors directive of the Content Security Policy. What isn’t clarified above is that it wasn’t the server/site I was working on that Refused to load from … Read more

Help with comments.php

This is not possible using the standard comment form. Comments in WordPress are built around post IDs, and are coded with this assumption down to the foundations. Even post statuses that can receive comments are hardcoded at multiple levels. The comment form itself knows where to go afterwards via the comment_post_ID input. You will not … Read more

Custom shortcode for displaying user based on a role parameter

First, you’ll have to get shortcode parameter(s). Change function’s declaration to: function display_user_roles( $atts ) { Your shortcode will be either [hw_display_users] or [hw_display_users role=”roletopass”]. The first (no parameter) will use role specified in $args array. Second will replace $args->role with parameter passed. Add if ( !empty( $atts[‘role’] ) ) $args[‘role’] = $atts[‘role’]; before $users … Read more