Change comment_reply_link URL

The following gets called by WordPress while getting the reply link. apply_filters( ‘comment_reply_link’, $before . $link . $after, $args, $comment, $post ); Use a custom filter to provide your own link. I don’t believe there is a direct way of altering just the URL, you have to inject the url into an html string yourself. … Read more

Warning: array_pop() expects parameter 1 to be array, boolean given

get_the_terms() will return a boolean false under some circumstances: A post with no terms assigned gives a false result, not an empty array. https://codex.wordpress.org/Function_Reference/get_the_terms#Returns It sounds like that is what is happening. You need to check that $post_link = to ensure that it is the type you expect before trying to use it.

How to store / access files in child theme folder

Can you place custom .php files directly inside the child theme folder? Yes, of course you can. WordPress is PHP. What works in PHP works in WordPress. Some of the research we found says you must write your custom PHP functions inside of the functions.php file. Nonsense. Many themes segregate code into multiple files, including … Read more

How to test for Super Admin

I got it to work as follows — in mu-plugins directory, my superAdmin.php script looks like this: <?php function check_for_superAdmin($user_login, $user) { $current_user = get_userdatabylogin($user_login); if ( is_super_admin( $current_user->ID ) ) { // do these things } else { // do other things } } add_action( ‘wp_login’, ‘check_for_superAdmin’, 10, 2 ); ?> Hope this helps … Read more

Click loads template via ajax

So, you’re using wp_localize_script to inject the ajax url. But you didn’t use the localized var handle to access that value. Try this: /* … */ $.ajax({ url: ajaxStuff.ajaxurl, // NOTE use of ‘ajaxStuff’ object /* … */

How to slow down server response

I don´t know why you would want to slow your website down, but PHP got sleep() which pauses a program for the amount of seconds you pass to it. You could then hook your function/plugin to init to halt your WordPress before it starts its output. That could probably do what you want. But why?