Questions tagged [filters]

A type of hook that provides a way for content to be overridden programatically

Filter by
Sorted by
Tagged with
0
votes
0answers
9 views

How can I hide the Orders on the admin side of Woocommerce?

In my Woocommerce shop I don't want to see some orders in the backend. Only individual orders should be hidden. In the front end I always do this with the element Picker and CCS display: none but that ...
0
votes
0answers
10 views

Yoast Schema Person ID and ACF issue [closed]

I am making a function that change the author of a post with a User custom field from ACF and I need the the Schema ID to change as well. add_filter( 'wpseo_schema_person', 'example_change_person' ); ...
0
votes
0answers
5 views

Filter taxonomy terms by custom ACF field in admin area

How do I add a custom filter to a taxonomy in the admin view (/edit-tags.php), and how do I use a ACF field as what to filter by? I know that you can add a filter to the post list view with the hook/...
0
votes
0answers
11 views

Checking For a Specific Parent Category from Subcategory Page

I want to write some code that checks to see the current category, and then checks to see if it falls under 3 potential parent categories. So if I had a setup like this: Market --food ---chocolate --...
0
votes
0answers
9 views

How i remove specific script from header?

I need to remove a specific line from the header when opening the site. How do I do this using a filter? <script src="url" data-pn-plugin-url="www.site.com/folder" data-pn-wp-...
0
votes
1answer
18 views

remove_action: how to access to a method in an child class?

I've this in my main plugin file: $main_admin_class = new MainAdminClass(); $main_admin_class->init(); MainAdminClass has this code: class MainAdminClass { public function init() { $...
0
votes
0answers
11 views

Limiting search to html heading tags

Is there a way to limit the Wordpress search function to only search among headings (as in <h1> to <h6>)? Or, ideally, to search among headings and post titles? I basically want to exclude ...
0
votes
0answers
7 views

Where to hook to force WP to create compressed copy of uploaded image even if its small

I want to write a filter function and need help figuring out where it would be best to hook in or if there is any possibility at all. My problem: I am utilizing the jpeg_quality hook along with ...
0
votes
0answers
5 views

Variable product price not displayed on live website [closed]

Added a variable product having different size and gave them the same regular price.On the live website the price does not appear next to product. But when I give them different prices then they are ...
0
votes
1answer
18 views

WordPress Gutenberg core/heading block (wp-block-heading)

I am really not sure how to write the code. How do I get all the headings from the page? To be specific, core/heading. I wanted to make a sidebar so that the user can just jump from one section to ...
0
votes
0answers
11 views

Woocommerce - Remove fields from woocommerce_form_field including validation

I am trying to customise the Woocommerce myaccount page, in particular the edit address page. I want to display both the shipping + billing address forms on a single page. Ideally, in a single form ...
0
votes
1answer
18 views

Filter works on last selection but no others

I have been working on a frontend filter using ACF Custom Fields. I can filter by the last selection states. but can't select any other option. Below is my code any help would be greatly appreciated. ...
0
votes
1answer
22 views

How to change footer credit text in Twenty Twenty One theme with a hook?

If I want to change the footer credits, I would usually copy the footer.php to a child theme and edit the following snippet: <div class="powered-by"> <?php printf( /*...
0
votes
1answer
15 views

Overwrite text in a complicated filter hook

I am very new to PHP and WordPress. I have learned only the basics of filter hooks but this one seems to be a bit complicated. I want to replace the text This action will let you pay a deposit of and ...
0
votes
0answers
8 views

Get ACF Taxonomy select values to update based on previous field selection

I have three Taxonomy fields on my page ('Sector', 'Subsector' and 'Key Role'). The Taxonomy itself is called 'Job Category', and 'Subsector' and 'Key Role' are both children of 'Sector'. So for ...
0
votes
1answer
16 views

Filter get_template_part() $args array

I'd like to be able to pre-populate all occurances of the get_tempate_part $args when setting up a theme. get_template_part( string $slug, string $name = null, array *$args* = array() ) Several ...
0
votes
2answers
98 views

Add a counter beside menu item label

I'm using the following code to add a panel to the admin menu screen, so the users are able to add a Cart link to their menus: function my_add_meta_box() { add_meta_box( 'custom-meta-box', __( '...
0
votes
1answer
12 views

How to hide/remove GhostKit component panel in gutenberg block inspector

is there a way how can I hide/remove components panel? There is one panel created by plugin GhostKit and I need to remove it, because it's not working properly and our users try to use it and it cause ...
0
votes
1answer
24 views

Set default value for “Additional CSS class(es)” for specific block types

For the columns block type, I'd like to add in a default value of wp-block-columns--padded in the "Additional CSS class(es)" field, the idea being that the user could remove or modify the ...
0
votes
1answer
14 views

How to write a filter to remove a form field (WordPress) [closed]

I want to remove a form field. How do I write a filter hook to remove it?
0
votes
0answers
21 views

How to redirect a unique link based on login status

I have webstore on woocommerce, and on one of my wordpress pages (that page is not woocommerce page, but just wordpress and it is edited by Colibri free theme) I have download links for some products. ...
1
vote
0answers
13 views

html tags in gettext hook get escaped

Hy everyone! Here I found this code function gb_change_cart_string($translated_text, $text, $domain) { translated_text = str_replace("original string", "modified string", $...
0
votes
0answers
56 views

Why does modifying the WP_Query in the pre_get_posts hook work for the front-end but not the REST API?

I would like to hide any post that has any of a certain set of custom taxonomies from public access. For example, a post with the "Access Group" taxonomy of "Finance Department" ...
0
votes
0answers
40 views

add blacklist moderation list inside pre_comment_approved filter plugin

i am using Comment Whitelist plugin to create a whitelist of email domains for autoapporing comments. It seems that the plugin overrides wordpress : Settings->Discussion options->moderation ...
0
votes
1answer
17 views

Woocommerce - Hide shipping at all, if only certain product or products with certain shipping class is in the cart

I am looking forward on how to hide shipping at all from the checkout page of Woocommerce when only certain product (magazine) is in the cart or much better would be, if the only product/s with ...
0
votes
0answers
9 views

Customize Menu Structure Creating a Section Where you can add icons/imgs

Basically i would like to add a section in "menu structure". So, when i access to any page/post i can create (for example) a select with some font-awesome icons class to every single <li&...
0
votes
0answers
16 views

Customising the default wordpress search functionality

I find the current from WordPress too strict as it doesn't allow for some minor spelling mistakes. How can I edit this function? I was checking out pre-get-posts however I don't think that allows me ...
1
vote
1answer
39 views

Custom query to filter posts that have current post as a taxonomy [closed]

Introduction I'm a graphic designer that knows nothing about PHP, but I need to get my hands dirty in this particular situation and I need help from the coding gods. I've been struggling with this ...
1
vote
1answer
17 views

Update posts after populating ACF field value

I'm running a function to populate some custom fields with some values specified: add_filter('acf/load_field/name=event_end_time', function($endField) { $endDate = get_field('event_end_date'); ...
0
votes
0answers
17 views

add_filter( 'the_title' gets through this if statement twice

I am using the accepted answer shown here: Apply the_title() filter in post & page title, but not in menu title For some reason, the code is getting through this if statement twice: if ( ! ...
0
votes
1answer
14 views

Changing the category for existing Gutenberg blocks

I'm trying to re-categorise some existing blocks (both core and third party). I've been told this should be doable using the registerBlockType filter but I haven't had much luck. Could someone share a ...
1
vote
0answers
14 views

How to create 'Local' filters for WordPress srcset sizes in template parts?

I've read a bunch of tutorials on how to create filters for srcsets and srcset sizes, but they all appear to be applied globally, with a fixed width or set of widths for sizes. The trouble is, I pull ...
0
votes
0answers
21 views

send comment notification message to website admin and post Author

In my wordpress installation i have in discussion settings > Anyone posts a comment + A comment is held for moderation active. On my site all users that can write posts are set as contributors. I ...
0
votes
3answers
37 views

Add class to woocommerce checkout body based on filter [closed]

I am trying to add a class to a checkout page if the checkout contains a subscription renewal. Woocommerce provides wcs_cart_contains_renewal() to check. I am using this code but obviously missing ...
0
votes
1answer
16 views

Inserting a string in the middle of page's permalink?

I know the more sensible approach for this would be to rely on archives so that my URL for news would be: domain.com/news/ However, due to how I am setting this up for the client to easily modify the ...
0
votes
0answers
5 views

filter products with first letter of product tittle an all product archive pages

I want to filter woocommerce products with first letter of their titles by request of get method like: ?alph=A I try bellow code but had no success: in function.php add_filter( 'posts_where', '...
0
votes
1answer
38 views

Filter Custom Post Type by Category with Ajax

I've used the below tutorial for my WordPress site to add a filter to one of the pages. https://www.youtube.com/watch?v=KRc47o8uDhk&list=PLSeCxQ7f7r87qbYmqXmOAcvoshw1e6ewQ&index=3 It works ...
0
votes
1answer
19 views

Add meta tags to a custom header

I'm trying to create php code to change the Wordpress header. With the help of https://wordpress.stackexchange.com/a/134524, I have the following: add_filter( 'wp_headers', 'add_meta_to_header' ); ...
1
vote
0answers
14 views

How to filter meta_values using REST API

i am able to get the data by make an API called with these args ?meta_key=frequent&meta_value=day are there any possible way to filter with multiple meta_value? i already tried meta_value=day,week ...
0
votes
0answers
9 views

signup_user_meta - changing meta information

Im tryng to modify (encrypt) the meta data that gets inserted into wp_signups. I checked how bbPress was adding information and tried the code below in functions.php to see if I could change a simple ...
0
votes
0answers
11 views

Running JavaScript after using WooCommerce Filter Plugin

I’m using the Product Filters Plugin for filter products on my WooCommerce Store. I wan’t to do a complex design for the filter menu with JavaScript/jQuery but once I click on one of the filter’s ...
0
votes
1answer
70 views

Filter posts with ajax form and checkboxes

I have a loop for my Custom Posts Type workshop filtered with two custom taxonomies group and teacher on the same page. The Ajax filter works perfectly. Each links of the filter works with a <input ...
0
votes
2answers
22 views

Ajax filter button display all posts

I created a loop for my Custom Posts Type workshop with two custom taxonomies group and teacher on the same page. The Ajax filter works perfectly thanks to the solution provided here. The user can ...
0
votes
1answer
34 views

Ajax filter with custom taxonomies

I created a loop for my Custom Posts Type workshop with the lists of two custom taxonomies group and teacher on the same page. What I'm trying to do is create an Ajax filter with both taxonomies. The ...
0
votes
0answers
19 views

Unpublished Pages Failing To Appear On Custom Path

The Context I have a domain, we'll call it example.com, where traffic travelling to this domain first hits a reverse proxy and depending on the path it is directed to two different containers. Traffic ...
0
votes
0answers
18 views

Update user role after Memberpress transaction

Currently working on a Memberpress site that offers courses for a monthly subscription. Certain user actions on the site will update their role. I'm looking for a solution for reset the role back to ...
1
vote
2answers
47 views

WP Filter to change the URL of an Anchor wrapping the last gallery image

We have a normal WordPress gallery on a development webpage. The page is custom content through Advanced Custom Fields, and we are wrapping the section above's content like so: <?php $content = ...
0
votes
1answer
30 views

How to add order status class to the body tag?

do you know how can we add CSS class into the body tag when a user has an (any) order which is on pending payment status? I tried this one but no luck add_filter( 'body_class', 'order_class'); ...
0
votes
0answers
16 views

Redirecting orders by company field

i want to setup a store with multiple store manager with WooCommerce. So when logged in customer make an order, I want that order to be assigned to specific store manager by company field. For example,...
0
votes
1answer
31 views

Filter Post Title without affecting screen-reader-text

Let's consider this code: add_filter('the_title', static function ($title) { return $title. '-boom'; }); Works fine, and adds '-boom' near all the titles. But, I also noticed that in some themes (...

1
2 3 4 5
57