A type of hook that provides a way for content to be overridden programatically
0
votes
1answer
123 views
How to change permalink on headlines in rss feeds?
On mysite.com/feed the headlines of my posts listed in the feed are linked to that posts permalink, for example mysite.com/my-first-post. This is standard behaviour.
But sometimes I would like this ...
1
vote
1answer
256 views
Custom search page and search by title, content and tag
Can someone review my code , I need to know better solutions or any bug.
Okey ! , I made a PHP file to get search results by parameters and search by title , content and tag
PHP's head look like:
...
0
votes
1answer
84 views
need correction with a snippet in functions.php
I use gravity forms and wp-favorites plugin (helps users select their favorite posts).
I am trying to auto-populate gravity form with the following snippet. It works pretty well but it shows only the ...
0
votes
2answers
53 views
Do not show a custom post if it belongs to a certain custom taxonomy
I am trying to block the visualization of a custom post, of type 'product', if it is assigned to certain values of the taxonomy 'product_cat'.
Strictly speaking, I would like to block the ...
0
votes
2answers
26 views
How do i remove the title from a specific page
Hi need to remove the title of a specific page, this one. I could do
add_filter( 'the_title', ai1ec_remove_title );
function ai1ec_remove_title( $title ) {
if( 'Calendar' === $title ) {
...
0
votes
3answers
142 views
How can I return shortcode output to the top of the content?
I have a shortcode called update which is used as follows
[update title='' date=''] this is some update, etc. etc. 2 paragraphs or more [/update]
This outputs some html that wrap the title, date ...
2
votes
1answer
48 views
Is it possible to use object in add_action?
So is it possible to do something like this with add_action?
class class{}
$my_class = new class;
add_action('init', 'my_class');
0
votes
1answer
171 views
How to allow visitors to filter posts by multiple taxonomies
I am trying to allow users to filter a custom post type list by multiple taxonomies. For Example lets say my custom post type is clothing and it has two custom taxonomies brand and type associated ...
0
votes
2answers
89 views
How can I display wp_link_pages before a shortcode, if it is used, or display after content?
I have the following shortcode in my content
[src]<a href="#">Some Link</a>, <a href="#">Some Other Link</a>[/src]
My post structure looks like this:
<?php echo ...
0
votes
1answer
58 views
How do I replace title with my plugin?
I am developing a plugin for WordPress 3.5. My blog's default title is "Test". Here is some code of my plugin:
add_filter('wp_title', 'my_replace_title');
function my_replace_title(){
return ...
0
votes
1answer
60 views
Can / should a widget plugin define its own Widget Area?
Should a plugin be able to add a widget area above the_content? (Without requiring template/theme changes.)
What would be the best way to do this?
Doubts: widgets typically echo output to the screen; ...
0
votes
2answers
68 views
add_filter doesn't work
I'm developing a plugin to replace a character for some user agents in titles, posts and comments but the filter doesn't work. Here is the plugin:
<?php
/*
Plugin Name: WP-HalfSpace
Description: ...
0
votes
1answer
92 views
Filter the_content to add something before each <h1> element?
I'm looking for a clean way of filtering the_content to add a piece of code before each H1 tag present in it. In fact, I have a long privacy policy text and I want to add a back to the top link before ...
0
votes
3answers
40 views
Finding actual functions added to hooks and filters
I'm trying to figure out how to find the actual function that's assigned to hooks and filters.
I've been looking at other questions asked here and found a couple plugins that are helpful for findings ...
-1
votes
1answer
27 views
filter just a portion of plugin function
I'm trying to edit just a few pieces of bbpress' breadcrumb default settings, but the filters I've tried end up replacing the whole function. How do you replace only bits? Here is the filter as it ...
1
vote
2answers
156 views
Adding schema itemprop image to the_post_thumbnail with filters
I have tried to apply filters to the_post_thumbnail() function using
apply_filters( 'post_thumbnail_html', $html, $post_id, $post_thumbnail_id, $size, $attr );
Here's the code I have come up with ...
5
votes
1answer
63 views
Add filter to blogroll widget
I'm trying to add <i class="icon-ok"></i> before the content inside the <li> of the blogroll widget. I'm assuming that's done through the link_title filter, but I can't find a ...
0
votes
1answer
62 views
Prevent menu from loading in a page template [duplicate]
Possible Duplicate:
Remove navigation from header in custom page template
Is there some way to remove wp_nav_menu in a page template? I can't find anything related to page templates other ...
1
vote
3answers
58 views
Where can you find the available filter tags?
In my attempt to alter navigations current-menu-item class, I found a possible solution http://stackoverflow.com/a/7941864/520265 ,
add_filter('nav_menu_css_class', 'my_css_attributes_filter', 100, ...
11
votes
2answers
549 views
How to make a image-size selected by default in Media upload - WP v3.5
Bare with me. I want to have a custom image size selected by default in the Media upload popup page. In Wordpress v3.4.2 and prior, this elegant code worked fine:
function ...
1
vote
0answers
84 views
How to add a filter based on custom field to admin user list [duplicate]
I have added a column to the user list using two wordpress hooks: manage_users_columns and manage_users_custom_column. That's working fine. Now I would like to filter the user list based on a custom ...
6
votes
1answer
791 views
Set media upload attachment link to none and hide it in WP v3.5
In the Media upload popup page, how do I set the attachment link to none and hide it in Wordpress version 3.5? The following filter worked fine in earlier versions of WP:
function ...
5
votes
2answers
786 views
Remove “Insert from URL” link in Media upload - WP 3.5
How do I remove the Insert from URL link in the new Wordpress 3.5 Add Media popup page? In earlier versions of Wordpress, this worked fine:
// removes URL tab in image upload for post
function ...
0
votes
1answer
95 views
add_filter on “the_excerpt” only works when post does not have excerpt
class my_menu extends WP_Widget
{
function widget($args, $instance)
{
// Excerpt length filter
$new_excerpt_length = create_function('$length', "return " . $excerpt_length . ";");
if ( ...
0
votes
2answers
669 views
Filter by custom Field for Custom post type Admin Listing
I have a custom post type "Article" which has a custom field "issue" that is the id number of a "issue" post type that i am selecting using a simple select box.
I want to add a drop down of issues ...
0
votes
1answer
93 views
Clean/filter HTML inserted to post content by XML RPC
An external service that uses XML RPC to publish some posts on my site adds some unwanted CSS styles and HTML to the post content.
I would like to clean it up using a HTML cleaner that I've built ...
0
votes
2answers
84 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 ...
0
votes
1answer
183 views
Using dynamic conditions in 'posts_where' filter
I have the following code which gives be posts that are published in the last 100 days
function smbd_cats_by_days ($where = '') {
$where .= " AND post_date < '" . date('y-m-d', ...
1
vote
1answer
61 views
Can I hook into get_avatar to supply a hash instead of an email?
I'm writing a plugin to PPK encrypt non-public comment data as a second line of defence against crackers (one of my sites was recently compromised, so I have been rather spurred into action!). To ...
0
votes
1answer
44 views
Hightlight search-terms with functions does remove or disable other filters?
I found the following two functions in order to highlight the current search term on my search-results page.
function search_excerpt_highlight() {
$excerpt = get_the_excerpt();
$keys = ...
0
votes
1answer
42 views
How to get changed post title in my custom plug-in which fires when 'save_post' is called?
I created a custom WordPress plug-in that hooks onto 'save_post" using add_filter(). I need to do something with the post titles and whenever a user changes the title, my plug-in cannot get the new ...
0
votes
2answers
63 views
Filter 5 latest post from the loop
Recently I made a theme for my wordpress blog.
Now I wanna filter(remove) my 5 latest post from the main page(index.php) and show them into slider.
Now my 5 latest posts are showing in the first page ...
0
votes
1answer
1k views
Woocommerce Product Category Widget - hide categories that have no products in stock
I'm using WooCommerce on my Wordpress site, and have a widget in the sidebar showing all product categories. It's setup to hide empty categories, and that works well. However, it still shows ...
1
vote
2answers
55 views
How can I insert some extra validation into the theme options' validation function using add_filter?
I'm using the theme options from the underscores (_s) WP theme as a base for my own theme options. If I wanted to insert the validation from the bottom function into the top function's $output array, ...
1
vote
1answer
247 views
posts_groupby problem
On my search page I want to group the posts by post type. To do this I've got the following:
add_filter('posts_groupby', 'group_by_post_type' );
function group_by_post_type( $groupby ) {
global ...
3
votes
2answers
544 views
add_filter and changing output captions of image gallery
I'd like to change only one output of native WP Gallery (in media.php)
On Smashing Magazine (link) author advises to change whole gallery_shortcode function.
But I wondered if is possible to change ...
0
votes
2answers
58 views
Filter and Search
I am working on my site which is a WordPress based site. It is a sweepstakes site well winprizesonline.com is the site which inspired me most. Now I want a dynamic search like that site on my site but ...
3
votes
1answer
290 views
Set JPEG compression for specific custom image sizes
I use various custom image sizes (by add_image_size) and I have set my JPEG compression to 30% with this filter:
function jpeg_quality_callback($arg) {
return (int)30;
}
add_filter('jpeg_quality', ...
1
vote
1answer
428 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 ...
1
vote
3answers
74 views
When to use actions and when to use filters
I'm trying to understand where to use filters and where to use actions.
Suppose I have a query in a plugin, which later add on modules might modify to change the results of the query, thus modifying ...
0
votes
1answer
28 views
How to separate a specific page's comments from other comments
I am using WordPress comments on a page as a Contact form. Comments from my Contact form page are set to auto approve and only visible to the logged admin. Now in the dashboard I would like to ...
0
votes
2answers
110 views
How to use filter on comment submission/insert
I am working on a small project for my family to share info, recipes etc. And I added a "@" mention feature. Now that the mention feature works I need to notify the user they were mentioned.
I ...
2
votes
1answer
88 views
How to Auto Approve Comments on a Specific Page?
I am using WordPress comments on a page as a Contact page and I am able to show those comments only to logged in admin.
Now I would like to automatically have any comments placed on my Contact page ...
2
votes
1answer
142 views
Search results sorted by post types
I am working on a site with several post types - 4 to be exact - and I am trying to setup the search results page to have a filter/sort the results by post types.
For example, when a person searches ...
0
votes
1answer
128 views
How can I remove the image attachment ALT field?
I've been using the technique described in this post to remove the caption and description fields in the uploads modal window, thus eliminating unused clutter for users. Since the title field is ...
2
votes
1answer
149 views
Taxonomy terms with edit/filter link in wp-admin, in the list of custom posts
I'm using get_the_term_list and manage_posts_custom_column to display the terms of a custom taxonomy in the list of custom posts, in the WordPress Admin.
add_action( ...
5
votes
3answers
436 views
Filter any HTTP request URI?
I want to filter any HTTP request URI done through the HTTP API.
Use cases:
The WordPress update check goes to http://api.wordpress.org/core/version-check/1.6/, but ...
0
votes
1answer
125 views
add_filter to the_content after apply_filters
I have a shortcode that outputs null ("").
What I'm trying to accomplish is to output a default message if the shortcode outputs null. I don't want to extend my shortcode because there may be ...
0
votes
2answers
253 views
Wordpress apply_filters() Arguments Missing
I'm customizing a Woocommerce Wordpress site.
In the Woocommerce product class (class-wc-product.php) the get_price function applies a filter as follows:
function get_price() {
return ...
0
votes
1answer
188 views
Displaying custom taxonomy in the admin list of a custom post type
I'm trying to list the terms of a custom taxonomy ('genre') in the overview table in the admin area for a custom post type ('station'). To get this, I tried the following code in my theme's ...

