Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

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

0
votes
0answers
10 views

Reverse engineering of WooCommerce Storefront filters

Good day, first I would like to apologize for the more theoretical question, but I'm in a desperate need of a lead and my Google searches didn't led to anything. I need an explanation on how to find ...
0
votes
0answers
17 views

How to add custom class to WooCommerce checkout field? [on hold]

I'm trying to add a custom class to input HTML tag at a checkout page in WooCoomerce. For example: I want to add .smartform-zip to input with name billing_postcode and same thing with ...
1
vote
0answers
11 views

WordPress Gravatar filter is removing my custom attributes

I am trying to add a style attribute on all the custom gravatar images. However, it is removing the style attribute before final output. Here is the code I am using: $background = ''; $args = [$...
0
votes
0answers
12 views

Filter in Category Archive with Custom Fields

My need is to create a category filter in the archive.php wordpress file, to filter recipes on that page, or combine them with other category or ingredients on a recipes blog. I access on the archive....
1
vote
1answer
39 views

Use add_filter on concatenated string variable

I have a HTML table that I am concatenating like this: $admin_table_output .= "Item Description: </td><td>"; $admin_table_output .= "<input type='text' name='name' value='$name'><...
4
votes
2answers
97 views

Modify existing plugin function using filter (without modifying the plugin directly)

I have the following function inside an existing plugin: public static function init() { add_filter( 'wcs_view_subscription_actions', __CLASS__ . '::add_edit_address_subscription_action', 10, 2 )...
0
votes
0answers
28 views

Conditionally remove a taxonomy from a post

I'm working on a custom post type with some custom fields. Some of these fields are taxonomy selectors, first i select a taxonomy called "type", deppending on the chosen type a second taxonomy ...
-1
votes
0answers
14 views

ajax checkbox filter for showing posts related to categories in wordpress with pagination [closed]

have to create the blogs page with filters using checkbox with pagination. when i click the checkbox it only filter the post on the same.. but i want to display all similar posts in the site without ...
1
vote
0answers
21 views

Get Time Taken By Each Action Hook in Wordpress

I am developing a Plugin, and want to record Time taken by each Action Hook, I am able to get all the Hooks Triggered on a Page with the Action and Priority, but i am unable to get the Time taken by ...
0
votes
1answer
18 views

How to edit embed filter for youtube video to allow responsive full width layout

Im trying to edit the suggested embed filter from wordpress.org to make youtube videos always stay 100% width inside its container div, while keeping the appropriate height dimension as needed. Is ...
0
votes
0answers
2 views

Create a filter inside category page

I'd like to create a filter inside a category page. The filter I'd like to create is like a menu in a sidebar that combine the selected category with another. It is for a recipe blog. So I have the ...
0
votes
2answers
31 views

Get The Caller (Plugin / Theme / Core) For All actions & Hook in Wordpress

I am developing a plugin which will show the caller of all the Hooks & Actions on a Page in Wordpress just like QueryMonitor. I know that global $wp_action & $wp_filter has all the information ...
0
votes
0answers
21 views

How to apply filter from text area

so i'm writing a wordpress plugin and need some insight on getting a problem of mine solved. Any help is appreciated. So i have my plugin options page with a textarea (option field) and a save button....
0
votes
0answers
7 views

Create Filtered page for category

I want to create a filtered page for a category, to make google index it. I'm making a recipes blog. My need is to create a "recipes with" and a dinamic category with ingredient. So "recipes with ...
3
votes
1answer
20 views

Tiny MCE editor stripping xlink:href parameter from SVG USE tag

I have an inline SVG tag with an embedded <USE> tag. HTML: <ul> <li><svg class="icon-user"><use xlink:href="#icon-user"></use></svg> My Account</li>...
1
vote
1answer
19 views

Remove action from a plugin class, forced to use global instance

I have been trying desperately to find a solution to this problem. There are instances of this issue all over this site (and others) but none of the answers help in my case. If you want to skip the ...
1
vote
1answer
30 views

How to query custom post types posts filtered by multiple custom taxonomies through a form selection

I'm trying to create a sort of selection menu, in order to select custom posts by different custom taxonomies. I did the selection part, but I can't get to output my post and I can't understand where ...
1
vote
1answer
13 views

changing font size and font of a custom message added after comment

hi i have added a code in function file of the theme to show a default custom message after the user leaves a comment of the blogposts . it reads like this . add_filter('after_comment_text', '...
1
vote
1answer
26 views

Wordpress nav_menu_css_class theme filter is not being called

I'm having problems getting a filter to work. I'm trying to add a class to each <li> element of a menu. This is on my theme's functions.php file: /** * Adds custom classes to the items in the ...
2
votes
0answers
19 views

Hide some items from Screen options in dashboard for products

I am trying to unset/hide some options in dashboard. I am trying it for products screen. Here is the screenshot Here is the code i tried to hide SKU /** Hide Dashboard widget by default via Screen ...
0
votes
0answers
26 views

Filter variable products and showing whats in stock for that attribute

A client has a store with variable products. We have "Size" set as an attribute. My understanding is that a product is ‘Out of Stock’ when all variations have been sold. What we are trying to do is ‘...
1
vote
0answers
12 views

Does a plugin with a AJAX button filter exist? [closed]

I would like to add something like this (see picture) to a website, with this functionality ( https://www.capitalone.com/applications/alexa/ ) Is there a plugin that can do this?
0
votes
0answers
23 views

How do I replace the images URL in widgets?

I wrote the script below to replace the URL of the images in the post content with the WordPress CDN link. (Yes, I know the Jetpack, but in my case I can not use it) <?php add_filter('the_content',...
0
votes
0answers
28 views

Customize plugin templates

I am attempting to make some pretty serious template customizations to some of my plugins (mostly Event Espresso). Obviously I don’t want to touch the core stylesheets and template files, since they’...
1
vote
1answer
21 views

How to order by taxonomy using wp_query

I have a custom post type with a custom taxonomy years, I would like order by this, I cannot find a solution.
0
votes
1answer
23 views

Add something after a filter

I'm using wp-crowdfunding plugin, and i try to add something in a filter. Here the original filter : apply_filters('wpneo_crowdfunding_frontend_dashboard_menus', array( 'dashboard' => ...
1
vote
0answers
28 views

Search and Filter

I am needing a search and filter option for a website. Please take a look at the example on this page, for the type of search and filter feature I am looking for: https://www.altec.com/inventory/ I ...
1
vote
0answers
23 views

Display filtered results into custom page

I am trying to use the "Search and Filter" plugin to give a wp_query filters, but I don't want it to go to the search.php file. I want the results to be pulled up on the current page. I have searched ...
0
votes
0answers
12 views

How to change the title of a woocommerce category / taxonomy page when a filter is applied

I am looking for a solution to come up with a new title for a category / taxonomy page when a filter is applied. Let's assume we have a webshop offering T-Shirts and we have a product attribute called ...
6
votes
1answer
195 views

Sanitize and data validation with apply_filters() function

Should we sanitize and validate the apply_filters() like the examples below? absint( apply_filters( 'slug_excerpt_length', 35 ) ); wp_kses_post( apply_filters( 'slug_excerpt_more', '&hellip;' ) );...
5
votes
4answers
201 views

Apply the_title() filter in post & page title, but not in menu title

I use the following code to change the title of WordPress posts and pages. But it changes nav menu item titles too, which I want to avoid. I want to change the title of posts and pages in: home page, ...
1
vote
2answers
23 views

Generating an nonce for Content Security Policy and all scripts - How to make it match/persist for each page load?

Hooking into the script_loader_tag hook and generating random strings is no problem, but how can I generate them once per page load and use them in both wp_head and script_loader_tag? I'd really like ...
0
votes
1answer
31 views

How apply_filters work in WordPress?

I know that how do_action works in WordPress. function foobar_func( $atts ){ // Action hook before any output! do_action( 'dr_before_get_qod_text' ); echo "foo and bar"; } add_shortcode(...
1
vote
0answers
24 views

Filter menu item <a> to add classes/attributes?

How can I filter the presentation of menu items to add classes to anchors? I already have the code below, in which I leverage the per-item "Description" field set in WordPress admin's Menus creator. ...
0
votes
0answers
12 views

Not all gravity form scripts are moving to footer

Hello I am using the gravity form plugin, and I am moving the scripts to the footer using this code: // GF method: http://www.gravityhelp.com/documentation/gravity-forms/extending-gravity-forms/hooks/...
0
votes
3answers
28 views

append to existing parent theme function

My parent theme calls a function: function get_nav_markup() { ob_start(); ?> <nav class="navbar navbar-toggleable-md navbar-inverse site-navbar" role="navigation"> <div ...
1
vote
2answers
23 views

How To Change The Html of Products filtration sidebar in Woocommerce?

I have Used the function dynamic_sidebar('sidebarId') in the sidebar.php file. and all the functionality of the sidebar is Working succsessfully My Question is How To Change the Html of the sidebar ...
0
votes
0answers
14 views

Hook/filter WordPress Importer plugin?

I have a large .xml (WXR) export from a historic WordPress site (6,000+ posts). I have installed the WordPress Importer plugin, and I'm able to use it to import the file. Whilst all posts' text gets ...
0
votes
1answer
21 views

How to trim white space in search terms?

I'm seeing a weird problem where if someone searches "Test Search" it's returning fine, but if someone searches "Test Search " it's returning some weird posts that don't seem relevant. How do I go ...
0
votes
1answer
31 views

Show custom taxonomy in theme

How do I show a custom taxonomy in the same places as the theme that is set to display category. I had the same problem with custom posts and solved using 'pre_get_posts' and $ query-> set ('...
0
votes
0answers
12 views

Insert custom taxonomy into category query

I created a custom taxonomy for a custom post but I have a problem. I would like to know how to enter the categories of custom taxonomy in the functions of my themes. It has some filter or something ...
1
vote
1answer
34 views

How can I remove posts of a certain category from homepage after a specified time period?

I would like to know how to remove posts from a certain category from my homepage after a certain time period (but not expiring the posts). My site is currently set to display my latest blog posts ...
1
vote
1answer
102 views

woocommerce_get_price filter hook not working for product variation price

I have modified my product price based on a user who is logged in with a "reseller" role. This works for my default products, but not for my product variation products. So my product price for a 50ml ...
1
vote
1answer
23 views

How to change the order (priority) of registered filters (or actions) (e.g. for the_content)?

Is there any way to change the order of filters for e.g. the_content before they are applied? What I currently have is the following ideas: /** * Print all filters for some hook. */ function ...
1
vote
0answers
35 views

How to change the post type a theme shows by default?

I have a theme that displays the normal post_type post, but want it to take the post from my custom post type my_posts_custom. I don't want to make this change manually on the theme. Are there any ...
0
votes
0answers
43 views

Use add_filter inside another function

I generated metabox for woocommerce gallery images. And i put there youtube video id. add_filter('attachment_fields_to_edit', 'video_link', 10, 2); function video_link($fields, $post) { $meta ...
5
votes
1answer
222 views

Add custom class to core blocks in Gutenberg

I'm trying to add a class to list blocks (core/list) in Gutenberg. Unfortunately, it looks like because some blocks like lists and paragraphs don't have the standard default class name of wp-block-{...
1
vote
2answers
45 views

Remove Extra Classes from Post Title

I want to remove tag, category classes from Post Titles of my WordPress blog. On the frontend, Wordpress generates extra classes for every single article title. For Example, this article, has these ...
0
votes
0answers
18 views

How to add a link to media file for every image inserted in content?

Usually when we want to add an image to a post with a link we need to select "Link to: Media file". This is by default selected as none but the following filter would change default selection to "...
1
vote
1answer
23 views

Current category link filter

In my theme i have an archive template for a taxonomy (taxonomy-cat_projet.php), in this template a have a list of these taxonomies links to allow users to select a taxonomy. Here is the code i'm ...