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

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

0
votes
0answers
6 views

Request filter query variables different on sites within multisite

I have a multisite setup, and I used the request filter from the Wordpress API (https://codex.wordpress.org/Plugin_API/Filter_Reference/request) to try to alter a query before a page load, and I took ...
0
votes
0answers
13 views

Custom Taxonomy - Using URL Parameters to Filter Posts

Whenever I try to filter my search results with two child categories of different parents, under the same taxonomy, I get this: /?selected-categories-industry=18&selected-categories-region=18-64 ...
0
votes
0answers
12 views

Need help displaying custom labels before prices in Woocommerce

Good Afternoon StackExchange; I am needing a bit of help on figuring how the proper php code to achieve the label set up on various products throughout my woocommerce store. Basically what I am ...
0
votes
1answer
12 views

Adding body class to html tag that already has language attrubutes?

In my theme (Underscores based). I have <html <?php language_attributes(); ?>> Then I'm calling the body class function on the body tag: <body <?php body_class(); ?>> ...
0
votes
0answers
18 views

Wrap WordPress Login Form in custom Div

I'm customizing the WordPress login form with the help of the WordPress Documentation. I'm using the described filters to alter the appearance of the form, mainly by injecting new CSS styles. I'd now ...
0
votes
0answers
14 views

How to change comment text while comment posting?

Can I add a filter to the wp_insert_post while posting a comment? I want to decode PHP tags before posting comment. Here is my code: function my_function( $comment_id, $comment_object ) { $...
0
votes
0answers
27 views

Remove action added in plugin class from theme

I am trying to remove action that is added via plugin in my theme. The below plugin class creates a portfolio page template but I don't want this page template in my theme. Is there any way to unhook ...
1
vote
1answer
33 views

How do i search post by jquery datepicker?

I'm working on the WordPress website I have my own search filter page, where I added the jquery datepicker, now I want to search post by datepicker? Html Code script> $(function() { jQuery( "#...
0
votes
0answers
52 views

How can I access the updated value of a class variable that changes after add_filter is run?

First, thanks in advance for any assistance. I'm working on an existing project where we're running a filter on the_content to insert ads after a specific number of paragraphs. Recently, we ...
0
votes
1answer
27 views

Filter template text

I'm trying to use the_content filter which works great on regular posts or pages with template files that use the_content() function. I'm trying to use the_content filter to change the text from a ...
0
votes
0answers
10 views

Is there a way to stop WordPress from automatically inserting <br> tags when using the API to post content?

I am using the API to automatically post blog content. In software, I create the HTML I want and then use the API to create the post but the result contains a bunch of line breaks and paragraphs so ...
0
votes
0answers
21 views

WordPress Pirates Ahoy! “Talk like a Pirate” Plugin

I'm trying to fix the Pirates Ahoy! Translate to Pirate for next year's "Talk like a Pirate Day" and I have most of the issues corrected but with WordPress 4.4+ the way the is handled is, apparently, ...
0
votes
0answers
9 views

Add a option to select in Media Library to personalize how items are showed

Is that possible? I found that media-view.js creates a query and has six base type of queries based on items field in select element on the upload.php page. I saw that the scripts come from load-...
-1
votes
0answers
15 views

The payment form is not displaying via this plugin

i have gone over this code so many times and i think i need a fresh pair of eyes to help me look through the code //configurations $current_payment_gateway = apply_filters('...
1
vote
0answers
23 views

Ajax post filters not working

I've been trying to create AJAX categories filters but I can't get the code working. I've followed these instructions : http://juha.blog/dev/wordpress/ajax-filters-for-wordpress-categories/ Edit : So ...
0
votes
0answers
20 views

Why always one post missing in wp query loop

I know this is duplicate of Why always one post missing but the solution suggested to use Hikari Hooks Troubleshooter plugin which was last updated 8 years ago and I was not able to comment on the ...
-1
votes
0answers
14 views

Gravity Forms pre populate column in list field

I'm trying to pre-populate a list field on Gravity forms. The following code works to a point but only prepopulates row 1. Something obvious i'm sure, but I can't work it out! add_filter( '...
0
votes
0answers
13 views

Customize Wordpress backend page editor

To build a web pages with Advanced Layout Builder, I want to customize the post page in wordpress backend by adding a new column "Advanced Layerslider" on table list of pages: The new column will ...
1
vote
0answers
67 views

How to create Woocommerce Product Filter Widget [closed]

I want to create Woocommerce Product Filter Widget similar to this : https://wordpress.org/plugins/woocommerce-ajax-filters/ https://wordpress.org/plugins/yith-woocommerce-ajax-navigation/ I want ...
0
votes
0answers
16 views

Creating a downloadable goods website

Hi guys hope you're doing well, Today i have a question about organizing downloadable content on WordPress Website. So the idea is that i will be uploading huge data on my wordpress website to allow ...
-1
votes
0answers
21 views

How to Organize Large WordPress Data?

Thank you for your precious time to read my problem. I am up for a project where i'll be uploading a huge amount of data on my WordPress website (Free Downloadable files), but I have only worked on ...
2
votes
1answer
27 views

Admin List Dynamic Heading

I want to modify dynamically the Heading1 that appears on top of the Admin List of posts. E.g. the Page heading of the Pages list. I have exhausted all possible searches I could think of and nothing ...
0
votes
0answers
22 views

Filtering custom posts by custom taxonomy and user role using get_posts

I'm trying to filter my custom posts in a get_posts loop by first checking if the current user has a particular role and then filtering by a custom taxonomy term. However, I can't seem to get the ...
1
vote
1answer
22 views

How to filter into post meta data before saving

I'm on a plugin, where I want to provide a way to my clients to filter data before saving. I know the best way is to provide a filter hook. So I introduced a new filter hook to filter all the post ...
-1
votes
0answers
18 views

Pagination doesn't work after filtering by form

Is it possible to have this filtering method with working pagination? https://www.youtube.com/watch?v=UBhzNpQ6SqQ It was asked from the author 9 months ago, but he hasn't answered. I tried many ...
0
votes
0answers
20 views

adding an action inside if condition not working

This is my function $enable = false; //if false is provided then the action should run and remove the breadcrumbs if($enable ===false){ add_action( 'init', 'woo_remove_wc_breadcrumbs' ); ...
1
vote
0answers
24 views

How to add an arrow to menu items has submenus

I want to add arrow (or anything like ...) after every menu item that have children menus. I know that there is some JavaScript solutions. But for some reasons (stability and ...), I don't want to ...
0
votes
0answers
17 views

Display Woocommerce Variation image when filtered in shop-archive pages

I am trying to get the shop page to display the variation image when filtered by user. Using WOOF - WooCommerce Products Filter. Currently featured image shows when filter for Variation. Each product ...
1
vote
1answer
34 views

Get_avatar filter?

I'm trying to display something below avatar in comments. How can I filter this ? Sorry I'm a newbie with Wordpress PHP development. In comment.php of my child theme I have : wp_list_comments( ...
0
votes
2answers
16 views

Setting proper query for multiple custom admin filters

I am adding custom admin filters for my custom post types. I am a bit confused about how to go with the parse_query filter in order to have my posts filtered based on 2 or more filters. Initially for ...
0
votes
1answer
20 views

function replace_text for entire page

function replace_text($text) { $text = str_replace('old-text', 'new-text', $text); return $text; } add_filter('the_content', 'replace_text'); Is there any way to apply this to entire page? I mean ...
0
votes
0answers
21 views

How to remove images from posts by their dimensions

There are lots of low-dimension images in our WordPress posts which have been inserted by mistake. We want to remove all <img> tags which has an image with height or weight lower than 200px. ...
0
votes
0answers
27 views

how to add validation for min and max date range of contact form 7

I have created a date field using contact form 7 and set some min and max date range. It works fine with date picker widget but using keyboard it does not get the valid date. So I have created ...
0
votes
0answers
15 views

How can I show hidden products when filtering in WooCommerce

I am looking for a way to show the children of a grouped product when WOOF - WooCommerce Products Filter is triggered. Before then I only want to show the parent product. Currently when on the /shop/...
0
votes
1answer
13 views

Native gallery custom html output

I've added image gallery to my page via Add Media > Create Gallery. I don’t want to output default html of the gallery, neither are sufficient options to change gallery sortcode's attributes: itemtag, ...
0
votes
1answer
29 views

Add suffix to price html does not work

I am trying to add a suffix through a filter hook to a product price in Wooommerce, but for some strange reason the woocommerce_get_price_html filter hook (like explained here) does not change ...
0
votes
0answers
39 views

Filtering “woocommerce shortcode” pages similar to product categories?

Woocommerce has category pages with filtering options.. Newer woocommerce themes even have price sliders in all categories.. But Categories arent always the best way to display your products. ...
1
vote
1answer
43 views

WooCommerce sort products by the actual product width(not the shipping width)

I have regular/simple products and products with variance in the database. Regular products and variations have a product width(_pm_width_inches) associated with them . I am trying to sort based the ...
0
votes
0answers
15 views

how to remove duplicate arrays from view

I'm trying to create a filter list based on a custom taxonomy. This is my array: Array ( [0] => WP_Term Object ( [term_id] => 121 [name] => Sistemas CIP - COP - SIP [slug] => sistemas-...
0
votes
0answers
16 views

which hook do I use to present a message to the user when he adds an image in a post by a URL

I will make a code that when the user tries to put an image via URL without the HTTPS will present an Error message, however I do not know which hook to use, the error would have to appear in the ...
-2
votes
1answer
54 views

ACF Load Field Groups Programmatically [closed]

I would like to load ACF fields for custom post types based on a set of conditions and NOT use Custom Location Rules. A brief use case / rationale: If CPT A exists AND Theme Option Y is 1, then show ...
1
vote
1answer
14 views

How to use filter hook “the_posts” with a function that refers to $this?

I'm using Carbon Fields to manage event-related metadata (such as event dates) for certain posts on my site, but I want to make sure that past events do not show up in my site's feeds. I need to use ...
0
votes
0answers
13 views

the_content() breaks html while generating exceprt up to “more” tag

So I have a post with img src in it, after which goes the "more" tag. Something like this: text <img src= http://images.com/images/image.jpg> text <!--more--> more text Notice the space ...
1
vote
1answer
43 views

When trying to override plugin's function by theme, my filter executes two times, I want it to run only a single time

Here's plugin function: function dokan_get_admin_commission_by($order, $seller_id) { $saved_admin_fee = get_post_meta(dokan_get_prop($order, 'id') , '_dokan_admin_fee', true); if ($...
0
votes
0answers
18 views

Add id attribute to h1 element of wordpress post

The default rendering of the h1 element of a wordpress post looks like this: <h1 class="entry-title"> XYZ </h1> I would like to add the id attribute to the h1 element with the value of ...
0
votes
1answer
18 views

Custom Bulk Actions handler not firing

I'm pretty new to Wordpress and PHP and am trying to add a custom field to a bulk edit list for a custom post. I've followed the following blog post but my handle_bulk_actions callback is not firing: ...
10
votes
4answers
148 views

Is there any action filter/hook for validating a custom field before publishing the post?

I have a custom filed called xxxx_url. xxxx_url should be unique. So, before publishing the post, I want to make sure that xxxx_url is unique or not? If it isn't unique, publishing the post should be ...
0
votes
1answer
22 views

Get post content with all filters applied, knowing post id

I've just started working with Wordpress and I need to get the content of a post with all filters applied (eg. the html content of the post as appears on the page after all the available filters have ...
0
votes
0answers
24 views

Filter ACF Repeater results by selected Taxonomy term?

Is it possible to filter the repeater by selected Taxonomy term? I have a repeater setup with multiple fields, one of which is a taxonomy field (ie: color). I'm needing to display only specific ...
0
votes
0answers
9 views

Wordpress Filters with conditions

I want to make an online shop with wordpress - woocommerce. How to create a search formular with following conditions: chose a car-make (audi, mercedes) chose a car-model(if audi selected show A1, ...