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

learn more… | top users | synonyms (5)

0
votes
1answer
11 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? ...
0
votes
2answers
56 views

Is there a wildcard/catchall filter hook?

I would like to filter all the options values, but the option filters are option specific. Is there a way I could do something like add_filter('pre_option_*', 'my_check'); ?
4
votes
4answers
192 views

Issues with title-tag and document_title_parts

Wordpress version 4.5.1 I'm trying to dynamically update page titles on a particular template. After lots of digging and learning about the wp_title() changes, I'm attempting to use ...
3
votes
1answer
40 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
612 views

Empty string supplied as input when parsing content

I have this code: <?php function mb_find_my_image( $content ) { if( is_home() ) { /* if is home start */ $dom = new domDocument; $dom->loadHTML($content); $dom->...
1
vote
0answers
13 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
23 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
40 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
2answers
521 views

apply_filters, EMBEDS and AJAX not a friends?

I encountered a problem... There is content that contains a YouTube link Lorem ipsum bla bla bla http://www.youtube.com/watch?v=nTDNLUzjkpg My plugin display this content with that code in the ...
0
votes
1answer
152 views

How-to inspect filter-able $vars?

Note: This is more of a tutorial/wiki than a real question and should be a reference for later Questions. If you got something to add, please feel free to add an answer. Working answers get upvoted. :)...
1
vote
0answers
47 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
1answer
17 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 ...
0
votes
1answer
19 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
2answers
20 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
0answers
22 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
1answer
41 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
2answers
1k views

Display only certain posts based on visitor's country?

Is it theoretically possible to have the following feature? Each post has a country code. When a visitor comes in, the system will determine the visitor's country code. Then when the page renders, ...
0
votes
1answer
186 views

the_content filter together with require_once returns 1 instead of the content of the included file

It's a weird problem that looks like to have something todo with the WP SEO plugin from Yoast. If I disable it ( and no other plugins are running ), the output is what I expect it to be. It shows the ...
0
votes
2answers
2k views

Filter categories using tags

I have a website with the following categories: Videos Pictures Stories And I have a lot of tags like: Funny, Awesome, Mind Blowing, Crazy, etc. Is there a way I could filter lets say: Videos ...
3
votes
1answer
46 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' , '...
-1
votes
0answers
8 views

How to strip image/code from rss feed?

I have a custom feed which uses a manual excerpt - which is identical to the text before the 'more' quicktag except that it has one line of code (with an image) removed. I think an appropriate ...
0
votes
1answer
414 views

Let Users Filter Posts by Custom Fields

I'm using the Advanced Custom Fields plugin to add custom fields to my posts, but was wondering what is the best way to go about creating a filter box for the user to filter through posts. I've ...
2
votes
2answers
79 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
1answer
27 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="...
1
vote
2answers
57 views

Shortcodes not resolved in AJAX call response

I have a simple function, which returns the content of a page with the given pageID: function get_page_content(){ $id = $_REQUEST['id']; $page_data = get_page($id); echo ...
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',...
0
votes
1answer
31 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 ...
0
votes
0answers
10 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 ...
7
votes
3answers
330 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?
1
vote
1answer
819 views

Using add_filter() in Widgets

Just have a query reference the add_filter() function. Can you use this function inside a WordPress widget class. Example I have a widget with dynamic created code that I want to pass to another ...
0
votes
2answers
47 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
2answers
655 views

Create subpage - filter parent pages list

I have a website here with a lot of content and with the content where is necessary to create pages in hierarchy. But it is uncomfortable to go through the dropdown in the administration with a lot of ...
2
votes
1answer
917 views

SSL certificate for the host could not be verified

I'm getting this error in a log file created by WooCommerce "The SSL certificate for the host could not be verified." The error is being generated by WordPress' file /wp-includes/class-http.php ...
0
votes
2answers
454 views

Can i use multiple 'the_content' filters?

I am currently using a 'the_content' filter to add some HTML to the bottom of my posts and pages. But, I want to add another 'the_content' filter to a handful of specific pages (using page IDs). Is ...
0
votes
1answer
840 views

How to add nav menu items to a specific position within a menu

I'm adding login/logout links to a nav menu using the following code: function rp_add_login_logout_links( $items, $args ) { $link = wp_loginout( get_permalink( get_option( '...
0
votes
1answer
14 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: ...
1
vote
1answer
3k views

ajax for filtering posts by category in wordpress loops

I've been looking around for a way to filter my posts on http://www.waziproject.com/wazimagazine/ without reloading the page. So my question is if anyone can help me out to turn the following into a ...
2
votes
1answer
26 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 ...
1
vote
2answers
598 views

How to use the 'comments_number' filter?

I'm not sure how to use this filter. Could someone show me an example? I'm trying to change ('0', '1', '%') to ('0 Comments', '1 Comment', '% Comments'). I'm using this function to get the comments ...
15
votes
6answers
8k views

single-{$post_type}-{slug}.php for custom post types

My favorite part of the Wordpress template hierarchy is the ability to quickly create template files for pages by slug, without having to edit the page in Wordpress to select a template. We can ...
0
votes
1answer
26 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?
1
vote
1answer
29 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: ...
0
votes
1answer
1k views

How to apply filter at search of woocommerce products?

I want to change woocommerce search. And want to limit the search to Product title and Category and Tag only excluding description and short description. Search Form is in plugins/woocommerce/...
1
vote
2answers
701 views

list category posts under its item in menu

When adding category to Menu, I need it to list all the item that belong to that category in separate UL automatically. like this http://i.stack.imgur.com/ulOOS.jpg Of course I can do that manually, ...
2
votes
1answer
42 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 ...
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
0answers
41 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
420 views

How do I safely force get_theme_mod() to use a defined get_option(“stylesheet”) value?

In our development process we have several branches of the same theme for each developer. Theme branches live in different directory names, so when doing get_theme_mod(), get_option("stylesheet") can ...
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 ...