Custom tax_query filter not working for Woocommerce product categories

I figured out what the issue was. The page was displaying categories/subcategories and not the items themselves. This meant that woocommerce_product_subcategories() was the one filtering and that uses a different hook. Here is what I added to my functions.php file. add_filter( ‘get_terms’, ‘get_subcategory_terms’, 10, 3 ); function get_subcategory_terms( $terms, $taxonomies, $args ) { $new_terms = … Read more

Is it possible to enable the ‘Link To’ field under ‘Attachment Display Settings’ for a Featured Image?

Sorry, what you’re looking for is not an standard WordPress feature. It might interfere with the theme, which could be built to already include a link to the featured image. That would lead to invalid html. So you’ll have to build this yourself using the admin_post_thumbnail_html hook, which allows you to add fields to the … Read more

How to find list of all functions bind to a particular hook from my plugin?

You can use this Plugin ! It supports following features for Hooks Shows all hooks fired on the current request, along with hooked actions, their priorities, and their components Filter hooks by part of their name Filter actions by component (WordPress core, Plugin X, Plugin Y, theme) https://github.com/johnbillion/query-monitor

comment_for() Custom fields not visible when user is logged in

Ok, so i tried this and it worked as expected, i replaced the above code (used in comment.php) with the one bellow. To correct this issue i simply checked if the user is logged in using is_user_logged_in() and then added the comment field to the $comments_args. <?php $comments_args = array( ‘id_form’ => ‘comment-form’, ‘class_form’ => … Read more

Stripping URLs & Email from post submissions

You can use the_content (Click here for more info) hook to change the content while rendering the post/page. This will be triggered when Post is being read from Database. So post content will not be changed in database but only filtered while rendering. add_filter( ‘the_content’, ‘remove_email_and_url_from_post’ ); function remove_email_and_url_from_post( $content ) { // Check if … Read more

Gravity Forms Anchor only on Front Page?

I found the answer here: How to create a plugin that only operates on the home page? I just had to wrap the filter in a function: function gravity_forms() { if (is_front_page()) { add_filter(“gform_confirmation_anchor”, create_function(“”,”return true;”)); } } add_action(‘template_redirect’, ‘gravity_forms’); Thanks, Josh