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

Restrict adjacent products in Woocommerce / Storefront to same category

I am using the Storefront (2.5.3) theme with Woocommerce (3.9.2) Currently I have product categories set up like so: Accessories > [Manufacturer] > [Model] > (products) e.g. Accessories - ...
0
votes
0answers
15 views

Add woocomerce category filters tabs in a product slider [closed]

I'd like to display a product category filter in a product slider like is shown in the image in order to change products when you click on those filters. Can someone tell me if there's a plugin or ...
0
votes
0answers
24 views

taxonomy_template filter not working on pagination [duplicate]

I have the below filter in my register method that will pull in a specific template file based on a custom taxonomy: add_filter('taxonomy_template', function($template) { if (is_tax( 'recipe-...
0
votes
0answers
27 views

AJAX Post Filter

On my website i made ajax taxonomy filter which is working fine with dropdown select, but i need buttons instead of dropdown. When i am editing code to buttons, filter isnt working, it shows mainc ...
0
votes
1answer
118 views

How to track a particular page in order to address the loading speed issue

Whenever I try to load a page of a particular website, I get the message while using Chrome browser on the left bottom 'waiting for xxxxyz.com.' How do I track the particular page so that I can remove ...
1
vote
1answer
11 views

Combine two filters into a single call

Is it possible to combine two filters? add_filter( 'manage_edit-post_columns', function($columns) { $columns['author'] = 'User'; return $columns; }); add_filter( 'manage_edit-recipe_columns',...
1
vote
0answers
51 views

Removing “wpautop” (auto <p> tags) only on certain pages?

I'm using the remove_filter in functions.php to remove the auto insertion of <p> and <br> tags on my wordpress site. remove_filter( 'the_content', 'wpautop' ); remove_filter( 'the_excerpt'...
0
votes
1answer
24 views

Moving Quantity after product description

Using woo-commerce I need to place the quantity after the description. Below attached screenshot shows expected output.
0
votes
0answers
12 views

a filter is leading to a 404 page [closed]

On my wordpress website i have 2 of the same filters(one on the home page and one on an other page) and use the Ultimate wp query search filter plugin. The problem is that the filter on the home page ...
0
votes
0answers
22 views

Dynamic page for nav items used as filters

I have a bunch of nav items and each of those items are used as a "filter", this filter means that when clicked the user should go to a page that has only the items matched with the filter clicked, my ...
0
votes
0answers
13 views

Custom post types on page with filter and pagination

How to apply pagination to the filtered results when filter adds the string '?filtr=1' after the domain name ? The filter works the following way... On my website (http://arche.cypis.net.pl/) after ...
0
votes
1answer
23 views

Retrieve a value from Yoast SEO to use to set a default twitter card image honoring overrides

So Yoast SEO has an issue where you can't define a global default twitter card image. So I'm looking to both set a default twitter card image but allow for the override on the specific pages to ...
0
votes
0answers
11 views

Filter term taxonomy metabox in custom post type

I have created a custom post type games and registered taxonomy game-filter. When creating game-filter I am adding "is_deleted" in term meta. Now, when creating a game, I want to display only those ...
0
votes
1answer
26 views

WP 5.3 Removing Default Wordpress Image Sizes

I've found several examples where they use the intermediate_image_sizes_advanced filter to unset the default WP image sizes that are generated whenever a user uploads a new image to the media library. ...
0
votes
1answer
20 views

How to add lazy field in content endpoint using Gutenberg blocks

I'm trying to add a "lazy" field to the "content" endpoint using "rest_prepare_post". I do this by adding "rest_prepare_post" filter. Then I check if "$post->post_content" has gutenberg blocks. ...
0
votes
1answer
30 views

Is it possible to assign a css id to a row in plugins list table?

How can I add a CSS id to the row that contains my custom plugin in the plugins list table i.e (/wp-admin/plugins.php)? What I want to achieve is displaying an admin notice like this <p>...
0
votes
1answer
17 views

Prevent reset password specific user role

I have user role "b2b_account". I want to prevent user who have role b2b_account to reset their password. Here my code add_filter( 'allow_password_reset', 'filter_function_name_2698', 10, 2 ); ...
0
votes
1answer
85 views

Fatal error: Uncaught Error: Class 'WP_Block_Styles_Registry'

I am having some issues determining the solution to this problem below. The website was sent to our team to fix. Turned on error reporting in wp-config.php: define('WP_DEBUG', true); ...
1
vote
2answers
29 views

When using the_author hook, how can I determine the PHP file that generates each call to `the_author()`?

the_author() filter hook can be used to modify the output of the_author(). When using the hook, is it possible to know which PHP file generates which call to the_author()? For example, say I have ...
0
votes
0answers
11 views

Get Order details from “woocommerce_order_details_after_order_table”

I want to show "Order details" with certain statuses (2) of the order in short code taken from "woocommerce_order_details_after_order_table". After login, the client is directed to a dashboard where ...
-2
votes
0answers
14 views

user search filter base of country state city wordpress

i need a feature like search members on basis of country-state-city along by name on frontend member page in wordpress.?(dynamic) it almost like product filter in woocomerce but i need the same ...
1
vote
2answers
28 views

Bypass “supress_filters” in WP Query

Apparently, for some illogical reason, the developers decided that the only way to fetch posts in all languages, is to add supress_filters=true to the WP_Query (instead of having like say, a ...
0
votes
1answer
69 views

Change AJAX filter from POST to GET for URL Parameters

I have a well defined AJAX filter, in two parts, one for a load more button, and one for a selection of drop down filters. Both reload a list of properties on the front-end in AJAX, and work together ...
0
votes
1answer
26 views

How to change lost password email text using custom plugin wordpress?

In wordpress, i want to add one extra parameter(ABC) in lost password link with key (lost password email text). I have added many hooks. add_action( 'password_reset', 'password_reset_hook', 10, 2 ); ...
0
votes
1answer
15 views

Use a filter on menu items that have children

I have a nested dropdown. On elements that have children, I would like to add a chevron beside the link text. The current HTML looks like this: <ul class="primary-menu"> <li class="menu-...
0
votes
1answer
15 views

Should I set a page as “No-index” if I include it's content within the front-Page.php via this method?

So I set my home page to "Your latest posts", and included this bit of code to get the info from a pre-defined page so that I can edit my home page, and get access to a "recent posts" grid with ...
1
vote
1answer
21 views

Woocommerce get billing state manually

Im modifying the receipts for the email admin notifications with woocommerce filter "woocommerce_email_recipient_new_order" Im conditioning them to the state wich the order is billed. For this there ...
0
votes
1answer
31 views

Can't check if a post has thumbnail adding filter to get_post_metadata()

I need to set fake thumbnails to all posts which have yet no a thumbnail. I use the code from the link core.trac.wordpress.org/ticket/40547#comment:1 But I can't check if a post already has a ...
0
votes
2answers
32 views

Mystery line break

I have a coding noob question if someone wouldn't mind taking a squiz. Trying to get the title placed on the same line as the label, i.e Label: Title Currently it's formatted as: Label: ...
0
votes
0answers
11 views

How to checking for conditions before going to payment page on checkout page

0 I am making a webshop and i have some issue with add_filter. When a customer is on a the checkoutpage, i want to check some condition when customer clicks on place order. Before it go's to the ...
0
votes
1answer
28 views

Is it possible to apply filter to meta key value when querying posts?

I am querying my posts and I am applying pricing orderby sorting filters below. But my product_price_from meta field contains a number which is inputted as various currencies. GBP, USD, AED etc. ...
0
votes
1answer
11 views

Create Post Types from a XML url (Real Estate website)

I have a URL provided by my Real Estate service that lists, in a XML file, every apartment and house that I have to sell. The XML url lists every detail of every apartment, things like images, year ...
0
votes
2answers
28 views

using filter and hook inside class

I'm going deep with oop to create wordpress plugins. I've found an interesting article about the hooks and how to use them inside a class. After reading I have some doubt: is correct to use the hooks ...
0
votes
0answers
43 views

How to make the_content() function to display only the text inside a specific paragraph targeting its class? [duplicate]

this is the content of a single post: Dec 4, 2015, First paragraph Feb 3, 2016, Second paragraph Feb 3, 2017, Third paragraph I am currently using a plugin named PHP Code which allows to ...
0
votes
0answers
18 views

Plugin or Method to filter portfolio by category and then subcategory

is there a plugin or already existing way to filte a portfolio or gallery by category and then inside the category by a subcategory? I did a quick search but nothing came up. Just filtering by a ...
0
votes
0answers
21 views

500 Internal server error wp_handle_upload_prefilter

I get a 500 error after I've added the wp_handle_upload_prefilter to my plugin class. How I can fix this? require_once 'vendor/autoload.php'; class MyClass { public function __construct() { ...
0
votes
0answers
19 views

How to bridge the gap between dynamic back-end data and front-end output?

I wish to allow people to extend my system in any way they want while maintaining its integrity. For example, I have a component in my plugin called Notifications. These notifications are output to ...
0
votes
0answers
23 views

How to loop year & month condition together to filter correctly via AJAX?

So I've been trying to create a filter function via AJAX that can help view the latest postings of a custom type post. So far I'm able to work out the AJAX part, and even the Year filter, however i ...
0
votes
1answer
17 views

How to override include_once pointed file using add_filter?

I want to customize a plugin which uses a file called html-vendor-order-page.php to define the style of contents: include_once( apply_filters( 'wcpv_vendor_order_page_template', dirname( __FILE__ ) . ...
0
votes
1answer
41 views

Is it possible to add a shortcode below post title?

I have a shortcode that I want to place below title of all my posts. Is there a hook or a filter I can use for this?
0
votes
1answer
31 views

Can't understand apply_filter logic

Never creates self filters before. In my plugin I have variable as array. I want another users can change this array without plugin modification. I'm trying this code in my plugin.php: <?php /* ...
0
votes
1answer
14 views

Consult array data in REST API Filter

Is it possible to make a filter with REST API Filter or any other technology to discover all elements that have job_listing_category = 86? Since job_listing_category is an array. Actual state: https:/...
0
votes
0answers
12 views

wp_video_shortcode_override in post editor

I am using wp_video_shortcode_override in my plugin to override default wordpress video and it works well in frontend. My question is is it possible to make this work in post editor backend? ...
1
vote
0answers
32 views

Extend core block attributes in post content

I need help with adding attribute 'caption' of core/image block into saved post content. Currently saved attributes look like follow: <!-- wp:image {"id":36,"sizeSlug":"large"} --> I aim to ...
0
votes
0answers
10 views

Is there a way to completely replace the sidebar in the admin panel?

Pretty new at this and was wondering if there is any way of completely replacing the sidebar in the admin panel? I found the hook do_action( '_network_admin_menu' ); but I'm not sure if that is the ...
0
votes
0answers
17 views

WooCommerce Product Table - filter query on attributes

I am using the Barn2 Product Table plugin with WooCommerce. I would like to modify the main query so that only products with a certain attribute are displayed (depending on the logged in user) I am ...
0
votes
0answers
17 views

Does having apply_filters in the middle of an array make a difference?

I'm trying to extend a plugin for Wordpress that loads several scripts through an array in 1 function in the footer. I have separate scripts in a separate plugin that I'm wanting to run along these. ...
1
vote
2answers
20 views

Why is conditionally loading a custom plugin's code only on a specific custom post type causing the site content to disappear?

I'm working on a fill-in-the-blanks plugin (https://github.com/liquidchurch/lqd-notes) which has been working. I realized that the plugin was loading its styles, js, and inserting a div on every page,...
1
vote
0answers
22 views

use wpml_post_language_details function other plugin based on $post->ID [closed]

I would like to use wpml_post_language_details function in other plugin based on $post->ID of WP. WPML language plugin wants to use for fetching lang information. I also wonder if i can use ...
0
votes
0answers
33 views

Filter posts by their related field's custom field

I have two post types named 'programs' and 'universities', where the programs are connected to their respective universities. I want to filter programs by university's custom fields such as ranking ...

1 2 3 4 5 51