Skip to main content

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
1 answer
7 views

Add an attribute on WP images attachment link

I have to add an attribute on WP images to add description on Spotlight lightbox. I tried the wp_get_attachment_link filter but it doesn't work. function add_data_description_link($content, $post_id) ...
Stefano's user avatar
0 votes
0 answers
12 views

Remove wpseo filter from polylang plugin

in polylang there is an integration file for yoast named wpseo.php that adds some translated urls to yoast sitemap, I don't want these urls since I'm doing a custom work on translations with my own ...
silvered.dragon's user avatar
0 votes
0 answers
6 views

Woocommerce price filter widget always shows max price of most expensive product in the whole shop

In my Woocommerce shop I use the price filter widget. In my opinion it should only show the max price of the current products in a category or search result, but it always shows the max price of the ...
redlevel's user avatar
0 votes
0 answers
15 views

Show post in elementor based on views and specific category with query id feature in elementor

I have two functions for query filter: function my_query_filter_most_views( $query ) { $query->set( 'orderby', 'meta_value_num' ); $query->set( 'meta_key', 'entry_views' ); $...
Danial Sohail's user avatar
1 vote
1 answer
43 views

Is there a way to auto-link to products when writing a post?

I have created a post where I list items in my product catalogue and add links to said products. Currently, I manually add links to the products once I have typed them out. However, I want to know if ...
Mus's user avatar
  • 117
1 vote
0 answers
13 views

wp reset password page - head inline script

In the reset password page, i have this core inline script in the head section : <script type='text/javascript'> /* <![CDATA[ */ var userSettings = {"url":"\/","uid&...
rafa226's user avatar
  • 121
0 votes
1 answer
10 views

How to use parse_query() to add an additional filter based on content to page search?

I want to add another filter box to my admin "pages" screen, let's call it search2. I want to be able to filter the results that I searched to be limited to only pages that contains search2 ...
user18102663's user avatar
0 votes
0 answers
16 views

WooCommerce Attribute Mapping

How to accomplish searching by Make and Model with data added as attributes? Basically I am facing this, I have a website for motorcycle parts and all the data is added as attributes so I have ...
h3k's user avatar
  • 1
0 votes
1 answer
27 views

Remove rel="ugc" from links in comments

I am trying to Remove rel="ugc" from links in comments, but nothing is working. I even tried Remove rel="nofollow ugc" from links in comments I also tried many plugins like: UGC ...
Jimmy's user avatar
  • 1
1 vote
0 answers
24 views

add_filter( 'user_has_cap','my_function', 10, 3 ); and call to get_users in my function triggers an infinite loop in user list

I use: add_filter( 'user_has_cap','my_function', 10, 3 ); In user list to allow users to edit only a specific list of users with a meta user identical to a current user connected. To get the list of ...
Alejandro Antolinez's user avatar
0 votes
1 answer
40 views

'Add Media' to post - filter images

Can anyone help me with this? ... I am trying to locate and understand the javascript and/or php/ajax code that filters the thumbnails that show in the interface when a user clicks "Add media&...
patrick_here's user avatar
0 votes
0 answers
28 views

get last part of page url and add it as cat in wp_query

I have a page URL : https://mwallpaper.ir/mobile-wallpapers/birds and I grabbed last part of URL with this filter : add_filter( 'example_filter', 'catslug_callback' ); function catslug_callback( $...
ehsan's user avatar
  • 1
0 votes
1 answer
41 views

Custom post type template not loading from plugin

I've created a custom post type called jdshs_jobs in a plugin and I have tried to get Wordpress to associate a template (single-jdshs_jobs.php) from within in sub-folder: .../plugins/plugin-name/...
Alex Adams's user avatar
0 votes
1 answer
40 views

FacetWP was unable to auto-detect the post listing : Having an issue with ACF load choices causing FacetWP error

I have a project website in which I am using Facewp to list custom posts on which I attached a custom field using ACF. I am using Extended ACF to make frontend forms to create/update those post types. ...
user55953 Asap's user avatar
0 votes
0 answers
18 views

How can we extent core/group or cover block?

I am working on a project and it has a requirement of adding separate background image for mobile devices. So is there any way that I can add InspectorControl on the core/group block for the mobile ...
up1512001's user avatar
1 vote
0 answers
30 views

Custom updater to change plugin version

I have a custom plugin hosted on github, and had previously had a plugin updater class that would poll the repo for the 'latest' version. Now the plugin is on multiple sites, but we want the option to ...
ConBran's user avatar
  • 111
0 votes
0 answers
22 views

Hide attributes based on previous selection

I've been trying to achieve this on my shop page but I am not able to. Basically I have 3 attributes, brand, model, year. I want to hide specific attributes or disable them ( make them not selectable )...
h3k's user avatar
  • 1
3 votes
1 answer
65 views

"Invalid parameter(s): attributes" issue in context of "blocks.registerBlockType" filter

The goal I'm working on a plugin that adds classes and attributes to any block. On the frontend the blocks are animated using JS and CSS. It basically works, but... It seemed to be working fine with ...
beat's user avatar
  • 43
0 votes
0 answers
17 views

Customize WP Filter Hook

I am using WP Form Locker Add-on Plugin. When you confirm your email the plugin sends you email with verification link. The email reaches in English. I want to make it reach in Arabic This is the ...
Zoro's user avatar
  • 1
1 vote
2 answers
16 views

How to override hook from themes functions.php which is defined in plugin

I have defined a apply_filters hook inside plugins_loaded hook in my custom plugin. $post_singular_name = apply_filters( 'post_singular_name', 'Event' ); new Prefix\Post_Types($post_slug, $...
Joe's user avatar
  • 11
0 votes
0 answers
25 views

Can't change WordPress / WooCommerce attribute value order

I'm making a website/webstore in WordPress/WooCommerce and ran into a problem with product attributes and swatches. We sell engraving materials (layered sheets) with a lot of different colors. So I ...
user23495269's user avatar
0 votes
0 answers
19 views

remove_function method removing next priority action too while removing current priority

I found a strange behaviour from the WP core related to remove_action, add_action('my_custom_hook', 'mycustomfunc2',99); add_action('my_custom_hook', 'mycustomfunc3',100); function mycustomfunc1(){ ...
amrtansh's user avatar
1 vote
1 answer
109 views

Attributes array not saving values

I followed along with this stack overflow I got everything working except for the values saving in myTest attribute array. For some reason it's not and I've been stumped for over a week on it. Here is ...
Dave B's user avatar
  • 25
0 votes
2 answers
17 views

Apply function only for specific post

I have a function to change the locale of the posts function change_og_locale( $locale ) { return 'es_ES'; } add_filter( 'wpseo_locale', 'change_og_locale' ); Now, I would like to fire it only if ...
NicoCaldo's user avatar
  • 147
0 votes
2 answers
82 views

How to change content hash value, within the_block_template_skip_link action?

When my WordPress site loads up, towards the top, I have something that is generated in the DOM.... <a class="skip-link screen-reader-text" href="#content">Skip to content<...
klewis's user avatar
  • 857
1 vote
0 answers
47 views

Possible to overwrite load_template function in plugin using functions.php

So, I am currently using a Wholesale plugin for Woocommerce which, by default, redirects users to it’s own Wholesale Store page. The caveat is that the Wholesale Store page only uses the archive-...
jayciemota's user avatar
1 vote
0 answers
10 views

Adding custom filter not working

this maybe a stupid question, when I’m trying to create a custom filter to hook into later and filter and return something, I don’t get any results. I am testing this in the themes functions.php //...
Aldo's user avatar
  • 11
0 votes
1 answer
27 views

How to filter the terms of custom taxonomy by author id in admin panel

I created custom taxonomy named 'Customers'. In admin panel, different users will login and create their Customers in that taxonomy. I want to show them their own Customers only. Currently they can ...
Ravinder singh's user avatar
1 vote
0 answers
38 views

Core/Image access caption in render_template and in wp.hooks

I am making an override to core/image block -disabling styles, changing markup and such. I have managed to solve some things, but struggle with some others. Here is my code: filters.php <?php use ...
Sam Tyurenkov's user avatar
0 votes
1 answer
77 views

Only show read more text when when wp:post-excerpt meets excerptLength

NOTE: The issue I'm encountering is specific to Block Themes; I understand how to filter the text returned from the_excerpt in a Classic Theme. What I would like to only show read more text when when ...
JDQ's user avatar
  • 149
0 votes
1 answer
150 views

pretty url for query parametr

I want this link: site.com/c/web/theme/?filter_cms=wp Convert to: site.com/c/web/theme/wp/ I found this code and edited it a bit: add_action('init', function () { add_rewrite_rule('^c/web/theme/([...
Monoor's user avatar
  • 13
0 votes
1 answer
55 views

Are blocks that are converted to patterns no longer filterable through the_content?

I have a block, say, elseloop/this-block, that was turned into a pattern on one page that it was included on. It is always displayed in an odd spot in the layout, so I want to pull it out of the ...
elseloop's user avatar
1 vote
1 answer
27 views

WP "optimizing" PNGs into thumbnails 5X larger than originals - FIX

As I am about to add over 50,000 product photos to a site in development, I am more than concerned about the thumbnails being generated and “optimized” by WordPress. Between WordPress, Woocommerce, ...
Swapot's user avatar
  • 11
0 votes
1 answer
27 views

How to use add_filter to add the extra data to existing array?

Hi I am new to hooks and have a query to add additional data to the existing array. Please check the below code. I have some basic details and want to add the Phone number using add_filter(). If I ...
Manikandan's user avatar
0 votes
1 answer
24 views

Overriding an existing filter

There is this function that is part of the plugin EasyDigitalDownlaods' plugin: public function category_dropdown( $name = 'edd_categories', $selected = 0 ) { $categories = get_terms( '...
Niko's user avatar
  • 3
0 votes
0 answers
37 views

filter the custom post type using wp ajax request

I want to filter the custom post type (events) using wp ajax request on behalf of the keyword supplied to it. Explanation: I have a from which has 4 fields displaying search keyword, event category (...
Manish Agarwal's user avatar
0 votes
2 answers
113 views

Show only taxonomy types terms associated with a custom post type in WordPress PHP

I am trying to display only the taxonomy types terms selected on a custom post type "newsroom". The code below shows all taxonomy types terms for every type of post. Is there a way to show ...
Justin's user avatar
  • 101
0 votes
0 answers
18 views

disable a specefic sidebar when user is log out

I want to disable a profile sidebar when users are logout if (is_active_sidebar('profile')) : if ( is_user_logged_in() ) : dynamic_sidebar('profile'); else : dynamic_sidebar('--...
D.JCode's user avatar
  • 201
0 votes
1 answer
205 views

posts_results filter - additional sort, with a meta value, to move posts to the end of the results, with pagination working

I have a custom post type for business locations that I am trying to add an additional sorting filter to by using a custom meta value. The custom field specifies whether or not the location is open or ...
user13286's user avatar
  • 255
0 votes
0 answers
62 views

wc_get_template_part filter not working

I am trying to replace the content-single-product.php template file from within a plugin. I am trying to use the wc_get_template_part filter to replace the content however the filter just doesn't seem ...
Ben H's user avatar
  • 363
0 votes
0 answers
21 views

WP_Query filtering in ACF field containing dates

I'm trying to use WP_Query to filter Advanced Custom Fields posts that can contain this value in the "dates" field (text type), for example "20230101-20230102;20230201-20230202;20230301-...
jakr's user avatar
  • 1
0 votes
0 answers
41 views

How can I filter records in a custom post type list in the admin based on the ACF field in the post that contains the current user?

I have a custom post type called Projects that includes an ACF field named team_members which uses User as a field type and returns a User Array. I want to filter the post type listing so that the ...
Rizal Kholif's user avatar
1 vote
0 answers
44 views

How do I add a filter to my custom post type archive page?

I used the guide HERE from acf themselves, but for some reason whenever I attempt to query anything at all in the url I get the "There has been a critical error on this website" error. $...
judahking's user avatar
0 votes
0 answers
50 views

Display featured posts first, then display all others within a specific category in WordPress

I want to display featured posts first, then all other posts not marked as featured on a category archive page. I am using a plugin that has functionality to mark posts as featured. I have figured out ...
user1462's user avatar
  • 1,294
0 votes
1 answer
47 views

hook on the_excerpt

I would like to have the excerpt length formatted + [...] and then keeping the 'read-more' as a button. I was able to hook the 'excerpt_length' from 55 to 25 and that was fine: function ...
made leod's user avatar
0 votes
0 answers
11 views

Filtering by Hard-coded WooCommerce Product Attributes

I searched everything and couldn't find an issue related to my problem. Most of our product attributes are hard coded in a way that they don't exist in Products->Attributes but are directly created ...
Nikola Donev's user avatar
0 votes
0 answers
33 views

Edit password change email text or disable it

I have a function in my custom plugin that will be called after the user do the fisrt login. The function, after a check will give to the user the ability to change it's assigned password with a ...
OHICT's user avatar
  • 133
1 vote
0 answers
38 views

Using send_password_email filter after wp_update_user

I have created a custom plugin that will provide some custom user roles that are named customers and operators. When an user will create a new account, I've created some logics that imply that ...
OHICT's user avatar
  • 133
0 votes
0 answers
20 views

Deactivate code made with add_filter

In WordPress I have a calendar (With the "Events Calendar Plugin"). I want this calendar to be for logged in users only. So I used this code: add_filter( 'tribe_events_pre_get_posts', '...
Haya's user avatar
  • 1
0 votes
0 answers
42 views

Why wordpress doesn't allow to add author filter to media library page in grid mode

It appears that Wordpress doesn't allow to apply new author filter to upload page (upload.php) in "grid" mode. If it's right, why? If not, does it exist a specific hook/function to allow ...
imagIne's user avatar
  • 83

1
2 3 4 5
60