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

learn more… | top users | synonyms (5)

0
votes
0answers
14 views

apply_filters with multiple args and multiple add_filter

I'm using apply_filters to bridge the gap between plugins but am struggling with the arguments. There is one argument, an array, there are several implementations of add_filter to match apply_filters ...
-5
votes
0answers
13 views

add_filter( 'post_thumbnail_html') vs wp_get_post_categories($posts[0]->ID) [on hold]

Hi there I have a problem bacause of: function my_post_image_html( $html, $post_id, $post_image_id ) { $sowot = wp_get_post_categories($posts[0]->ID); $large_image_url = ...
0
votes
1answer
12 views

How to filter url on post submission?

I would like to swap out image URLs upon post submission on both content editor field and a custom field cover_image of a custom post type article. For example, the original content may contain image ...
0
votes
0answers
19 views

how to filter post only parent in admin list table

I make custome post type hierarchy and than i make some post consist of parent and child, on list table it showing like this : parent_1 child_1a child_1b parent_2 child_2a child_2b My ...
0
votes
0answers
31 views

How to disable wp_trim_excerpt filter

I have a Divi child theme. I'm using the blog module to list out the blog posts. If the post excerpt field is empty, I don't want the post contents to be extracted instead. Having Googled, I came ...
0
votes
1answer
19 views

Add class to first post in custom loop using post_class filter

I am trying to add a class to the first post in a custom WP_Query. I can add a class to the first post of the standard WordPress loop using; add_filter( 'post_class', 'featured_classes' ); function ...
0
votes
1answer
18 views

Search content for shortcodes and get parameters

In content I can have multiple shortcodes like [book id="1"] [book id="14" page="243"] Is there any help method with which I can search the content for that shortcode and get its parameters? I need ...
0
votes
0answers
19 views

How to find all the available hooks in a theme

I have invested time and money on a Wordpress theme with a terrible support service. I have to fix bugs and implement new features myself. But I prefer to do it through filters and hooks. For example:...
0
votes
1answer
20 views

What is the action hook to use if you want to capture the new password during password change?

Clicking the Update Profile button in the [wordpress]/wp-admin/profile.php admin screen will allow the user to update his/her profile including the password. What is the right action hook to use ...
0
votes
1answer
12 views

Change url to posts if they have custom tax only

I have custom taxonomy "category_slider". function taxonomy_slider() { $labels = array( 'name' => 'Категории проекта', 'singular_name' => 'Категории', 'search_items'...
1
vote
0answers
25 views

How to get list of all hooks of current theme / plugin?

I want to get the list of all available hooks from active theme / from a specific plugin. I was tried to get it from global variables $wp_actions & $wp_filter But, They are showing all registered ...
0
votes
0answers
15 views

How to use $prev_url and $next_url to display posts only out of a specific category

Struggling with a function used to display a previous and next button on a single portfolio page. I have set two pages up with display of a portfolio. Each page displays a portfolio with a unique ...
0
votes
0answers
22 views

Custom default Gravatar with random function

I want to alter the default comment avatar behaviour on my WordPress site. As far as I understand the avatar_defaults filter can only do a static default avatar, but I'd more go with a random ...
3
votes
1answer
85 views

Exclude filter on front page

I am using this code in functions.php to append a button for link to a post. function new_excerpt_more($more) { global $post; return '<a class="excerpt-readmore" href="'. get_permalink($post-&...
0
votes
1answer
85 views

Add Adsense code between job listings - wp job manager plugin

I am using the wp-job-manager plugin and i want to add an Adsense code between the job listings ( after fifth job listing ) in the page with [jobs] shortcode. The function that outputs the jobs ...
0
votes
1answer
25 views

How to allow users to view pending posts of a specific custom post type?

I have a form on the front end that allows users to post a custom post type. The posts enters the database as pending for later moderation, how do I allow users to view these posts on the front end? ...
1
vote
0answers
20 views

Filter multiple custom fields Values with Check boxes

I create check boxes with name of custom field value. Here is 2 custom fields and every field have 2 type of values. need to show filter result of selected boxes?? every custom field have two type ...
0
votes
2answers
24 views

Prevent add_filter being applied to wp-admin pages

I'm applying a filter to a custom fields plugin. add_filter('acf/load_value', word_swap); My problem is this applies it to pages within the wp-admin also. I only want the filter applied to the ...
0
votes
2answers
41 views

How to apply a filter to everything?

I'm wanting to apply a filter to everything. add_filter('the_content', word_swap); Is there a term I can replace the_content with that'll target all functions?
0
votes
1answer
22 views

Output dynamic_sidebar_params in wp_head

I have created a custom widget with a color picker field. Currently there are two ways to output the color picker value for this widget: Inline style. Using the dynamic_sidebar_params filter. With ...
0
votes
1answer
21 views

menu-item class missing on wordpress menu

I have this code in my header.php and its working properly except showing li's without menu-item class, its showing them with page-item instead. this is when i dont have a menu created from admin and ...
1
vote
0answers
48 views

Filter $cpt categories to omit certain category

I have 5 categories (with matching slug id's), 'deps', 'duo', 'five piece band' and 'soloist' as part of my 'portfolio' custom post type. I want to display everything but 'deps' on one page, and then ...
0
votes
2answers
26 views

Add Filter to get_next_posts_link

As we see in the source, we can apply filters for $attr. So I create something like this function asdff(){ return 'class="iamclass"'; } add_filter('get_next_posts_link', 'asdff',10,2); or ...
0
votes
1answer
55 views

Shortcode to eliminate <p> and replace </p> with <br>

I have a filter that removes opening p tags and replaces closing p tags with a br tag sitewide. The client would like this filter in a shortcode that they can use only on specific portions of the site....
3
votes
1answer
51 views

Save Filter for Taxonomies

I want to get rid of undesired HTML, mostly being published by my editors when copying text from other sources, like other pages or from Word Therefore I use add_filter( 'content_save_pre' , '...
2
votes
2answers
89 views

do_action and hook methods

I am trying to understand how hook methods work in WordPress. I understand that when do_action is called WP looks for all registered listeners and invokes them according to set priority. How does ...
0
votes
0answers
29 views

Filter User Query

I am using the code below to display all of my users on the front end. <?php $args = array( 'meta_key' => 'last_name', 'orderby' => 'meta_value', 'order' => 'ASC', '...
0
votes
0answers
14 views

Realtime filtering of posts in blog view

I'm looking for a way to filter the list of posts by a search term. For example: There are 20 postings on the blog in total. In a search field you can enter a term and without loading a new page you ...
0
votes
1answer
33 views

How to use apply_filters?

So I am using a plugin which loads next posts as the user scrolls down in the single.php file. Inside the main php file of the plugin, there is something along the lines of // By default, don't ...
7
votes
3answers
353 views

How can I modify the WordPress default widget output?

I don't want to style the default widget with only CSS. I want to display the default 'Categories' widget content with my own HTML structure. Is there available any filter or hook to do that?
0
votes
2answers
50 views

Disable resizing of gif when uploaded

Animated gifs are getting more popular on the web (again) and currently there is no good tool for resizing animated gifs. So I want to disable resizing/generation of image sizes for the gif mimetype ...
0
votes
1answer
34 views

Grouping and paging CPT events by month with custom field date

$start_date = date( 'ym01' ); $end_date = date( 'ymt' ); $meta_query = array( 'key' => 'event_date', 'value' => array( $start_date, $end_date ), 'compare' => 'BETWEEN',...
3
votes
1answer
41 views

Creating search filter through plugin

I'm using wordpress for real estate project, for that, I am using a theme together with a plugin (realia real estate) to real estate. So I believe that this not is beside the point ... My question is ...
0
votes
1answer
15 views

Add a filter to an action [closed]

I feel like this is a really simple question, but I can't seem to find anything. I want to add a filter to an action, so I can run preg_replace on it to add a class to a link. The action is: ...
0
votes
1answer
30 views

tiny_mce_before_init: 'exact' => true has no effect

For a custom theme, the editors want to be able to select three different font sizes in the post editor. I thought about using a standard font size plus defining two extra classes: <p class="...
2
votes
1answer
30 views

Is there a filter hook that I can use to change how taxonomy term names are displayed?

I need to hide a custom taxonomy's terms' names on the frontend while preserving them on the backend. Instead of the terms' names I need to display pseudonyms. I can't find a single filter hook to do ...
0
votes
1answer
30 views

Hide Admin posts & pages in Dashboard

Is it possible somehow to hide Admin's pages & posts from dashboard so that other users will only view/list non-admin publications?
2
votes
1answer
37 views

return values from hooks do_action and apply_filters, which is better

Myself wondering among the following methods which is better to update an option value where value to be updated is coming from an ajax callback. Since Wordpress Codex clearly says apply_filters is ...
0
votes
0answers
18 views

How to Modify all of an action outputs

There's a plugin in my site that allows to introduce extra information with the following action call: do_action( 'bp_before_member_header_meta' ); Another plugin adds some of it with add_action: ...
1
vote
1answer
22 views

Amend wordpress password function

I simply want to add a H2 or whatever html tag above the content in this password protection function. Is this correct? function my_password_form() { global $post; $label = 'pwbox-'.( empty( $...
0
votes
1answer
95 views

WP Job Manager - display search results from custom search form in taxonomy-job_listing_category page

i want to ask something about wp-job-manager plugin. i have been already created a taxonomy_job_listing_categoy template to list all jobs from a certain job category. You can see an example here: http:...
0
votes
1answer
24 views

Hook for plugin to show content for certain urls

New to WP development. I want my plugin to dynamically show content for certain urls, for example, when the user navigates to /my-plugin or /my-plugin/key, my plugin would provide the content. The ...
2
votes
1answer
46 views

add_filter priority problem

I'm using basic user avatars for use local avatar in wordpress. And i have a simple function in my functions.php for getting avatar direct link. My problem is if i use get_avatar function in my ...
6
votes
2answers
208 views

Insert Custom HTML After Shortcode

The scenario is that I need to add an HTML banner under a slideshow which is a shortcode in the homepage content. I personally hate adding a bunch of div tags to the TinyMCE editor so I'm trying to ...
10
votes
2answers
203 views

Add custom options to the wplink dialog

I managed to add a custom option-select for images with function attachment_field_credit( $form_fields, $post ) { $field_value = get_post_meta( $post->ID, 'first_image', true ); $...
0
votes
1answer
18 views

Adding user filter - Not updating data in URL

What I am trying to do I am trying to add a filter option by adding a dropdown menu that i have hooked onto restrict_manage_users, so i can filter users by a specific meta value. My problem When i ...
0
votes
2answers
65 views

How to alter local query, not main query [duplicate]

I've done a wp_query in a shortcode. So, in page xyz I've two wp queries, one is the main query, and other's mine. The SQL query that I got from the query doesn't fit my desired affect. So I need to ...
4
votes
2answers
44 views

Filtering comment permalinks when a condition is met

I can't figure out how to filter the comment permalink on certain WP page that I use like this: if(condition is met) { (filter the comment url) } ...so that all the comment permalinks inside the ...
1
vote
1answer
39 views

Change Page's <title> Tag Using functions.php File

In my child theme's functions.php file, I'm trying to change a page's title tag: function custom_title() { return "Page Title"; } add_filter( 'wp_head', 'custom_title', 9999 ); The code above ...
3
votes
2answers
42 views

add class to term_description

trying to filter the output of term_description to include a class https://codex.wordpress.org/Function_Reference/term_description function add_class_to_term_description() { ?> <?php echo '&...