A type of hook that provides a way for content to be overridden programatically
1
vote
2answers
62 views
Failed to invoke other hook from the init hook
Related to this question (Use wp init hook to call other hooks?) but not the same.
Sometimes, I found that the hook will failed to run when I place inside the init hook, e.g.
Not Work:
...
0
votes
1answer
236 views
How to Filter categories in the permalink structure
Using /%category%/ %postname%/ for the permalink I get a URL string of all the categories that the specific post is included in. I would like the categories in the url to be filtered down.here it is,
...
1
vote
1answer
175 views
Remove bulk actions based on user role or capabilities
How can I remove the "bulk actions" based on user roles or capabilities.
Actually I have this code to do the job, but now I need to exclude the site admin, I need to let the administrator to access ...
0
votes
1answer
2k 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 ...
4
votes
1answer
233 views
Custom Rewrite Rules Not Sticking
I've written some custom rewrite rules for a special feature on http://www.pewhispanic.org/states/. States is a page with a custom page template, page-states.php. The logic for returning the right ...
1
vote
1answer
403 views
How can I filter posts by post_parent in the admin?
I have followed this tutorial and this one to add a custom column to a custom post type edit screen, showing the post parent of each post. My question:
How can I make the post parent clickable just ...
2
votes
4answers
196 views
Filter link to existing content suggestion
How can i filter the link given in "link to existing content".
Eg:
As in the above image. I just want WSP BANNER TO BE SHOWN.
where WSP BANNER & CALENDAR are custom POST types
Any help will ...
1
vote
3answers
7k views
Remove title attribute from images
I'm looking for a way to remove the title attribute from images, preferably through using a hook or a filter.
Most clients don't bother giving images a proper title, thus eliminating the purpose of ...
2
votes
2answers
112 views
Filtering 'the_title' with option to return subhead?
Problem:
The WordPress iPhone app (and other WordPress-related smartphone apps) do not allow for much other than the Title and Body fields (i.e. no access to custom fields).
Goal:
My current ...
0
votes
1answer
20 views
Adding an orderby filter, casting postmeta with multiple keys
I am using this filter to sort my query by a date field stored as text (legacy data)
add_filter( 'posts_orderby', 'my_posts_orderby_date', 10, 2 );
function my_posts_orderby_date( $orderby, $query ) ...
6
votes
3answers
3k views
apply_filters() and the_excerpt are giving unexpected results
I feel like I must be missing something pretty obvious, here, but I can't seem to get WordPress to cooperate.
I'm generating Facebook OG tags with a function. Everything works fine, except for the ...
0
votes
0answers
18 views
restrict_manage_post to remove filters
Using restrict_manage_post, is it possible to remove default WP-List-Table filters? Example that I tried, but failed below:
add_action( 'restrict_manage_post', 'remove_cpt_filters', 99);
function ...
11
votes
2answers
572 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 ...
0
votes
0answers
50 views
Custom excerpt_more filter not working when <!--more--> tag is present
I'm doing this inside Thesis 2, in case that matters.
I am using the_excerpt(); on my blog page to get the posts. And I'm using two custom filters:
function custom_excerpt_length( $length ) {
...
2
votes
1answer
162 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
0answers
20 views
Filter by Author on Category Pages
I'm looking for a solution to filter/sort posts by author on category pages/archive pages, ideally by means of a drop-down menu.
I've searched the Wordpress plugin repository but cannot find any ...
0
votes
0answers
43 views
How to filter a job search by city and state in a job board like Jobroller?
I'm working on a job board for a client using Jobroller. The client wants on the sidebar buttons representing states and when clicked on, display job listing based on that city. I read that Jobroller ...
3
votes
1answer
48 views
How to add a “publish” link to the quick actions
I'm trying to add a "Publish" link by the quick actions:
but I'm not exactly sure of how implement it.
Here's what I've got so far:
add_filter('post_row_actions', function ( $actions )
{
...
0
votes
1answer
34 views
option_active_plugins filter not working
I added a filter for option_active_plugins to keep most plugins from loading on an admin page. Confirmed to be on the right page and to be returning a properly altered array, but it's having no effect ...
2
votes
1answer
40 views
What functions are included in apply_filter('the_content')
There is a function called apply_filter where you can use it like this:
echo apply_filter('the_content', $my_content);
It add formatting tags and clean up the content.
Trac or docs
I looked in ...
-1
votes
1answer
161 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 ...
7
votes
1answer
332 views
How to create an API for my plugin?
I have been developing plugins for WordPress. Most plugins I have developed with two three classes and not so huge like Buddypress, WooCommerce or etc.
I am planning to make two open source plugins ...
0
votes
1answer
57 views
Custom search form to display users only
I'm trying to build a custom search form for one of my pages. I need the search form to be able to search for users. Not only will it need to search for users, but by first name, last name etc.. ...
1
vote
1answer
39 views
Make parent category not selectable when it has child categories
I'm trying to find a way of disabling the selection of the parent category within Wordpress 3.5.1 (post editor screen) only when that parent category contains child categories.
My structure:
...
1
vote
2answers
1k views
plugin_action_links Filter Hook Deprecated?
http://adambrown.info/p/wp_hooks/hook/plugin_action_links_%7B$plugin_file%7D
Says the hook is deprecated. However, the {$prefix}plugin_action_hook_{$plugin_file} is not. I poked around the ...
3
votes
1answer
131 views
Integrate post tags in Post Edit page with qTranslate
Summary
In the tags widget in the Post Edit page, I need to know a way to filter through:
the tags suggestions
the tag terms update when saving or updating the post
At least that is what I think ...
-1
votes
1answer
41 views
Search from Post on the basis of custom fields
I have shown all the Post on a page. Where i want to add Filter for sorting Like Date and other Custom Fields.
So how can i Do this Please Help me.
0
votes
1answer
36 views
page wordpress add extra unwanted stuff
i want to add this part to wordpress page but every time i add it wordpress add extra stuff that stop it from working properly this is my code
<li data-hovercolor="#e859c5">
...
0
votes
1answer
30 views
Removing an action, or dequeueing style - Both not working
What I am wanting to achieve is to remove an action called inside of another action.
The action is calling a style, and although I have tried to deregister, and dequeue the style, it is still ...
4
votes
3answers
925 views
LESS CSS enqueue_style with add_filter to change rel attribute
What I'm trying to do is use less css with Wordpress.
You're supposed to link to your .less files with the rel attribute set to 'stylesheet/less'. But I can't figure out how to alter the code that ...
1
vote
2answers
40 views
Replace a word with a word in the URL string
I'm trying to replace a word on every page for example "Denver" with a word from a URL string, so I'll have like ?city=Atlanta in the URL. So I was thinking of using PHP's GET to just get the city ...
0
votes
1answer
44 views
Adding filter to the title without affecting the menu title
Hi I'm having problems with the the_title filter here's the code that I have:
function zen_title_filter($title){
if(is_singular()){
if(!empty($_GET['asin'])){
if($title == ...
0
votes
1answer
111 views
How to edit php code in WordPress Post file?
I have a wordpress page. In that wordpress page, user will have access to the following Window to Publish their Post in to the webpage.
If the user enters an URL in any of the three filed I have ...
0
votes
1answer
18 views
Is it possible to put the add-filter()-hook into a function?
for my plugin with a lot of different features, I want to realize a mail-function to send HTML-mails. For this I have to add a filter-Hook like this:
function set_content_type($content_type){
...
0
votes
2answers
80 views
Add class to menu items of one specific menu (nav_menu_css_class)
This code adds an extra class to all my menu items:
add_filter('nav_menu_css_class' , 'special_nav_class' , 10 , 2);
function special_nav_class($classes, $item){
$classes[] = 'btn';
return ...
1
vote
2answers
107 views
Trouble understanding apply_filters()
In apply_filters()
apply_filters( $tag, $value, $var ... );
I'm having trouble wrapping my head around the $value and $var. I read the codex and it sounds like the $value can be modified, $var not, ...
2
votes
1answer
70 views
add_filter and remove_filter added before and after wp_query
I have just started with WordPress Development, and found following block of code online (in some tutorial)
function filter_where( $where = '' ) { // posts in the last 30 days
$where .= " AND ...
0
votes
1answer
80 views
add <div> to end of post in the loop with plugin
I'm looking to add a <div> with some more html content to the bottom of specific posts in the loop. The the_post action can be used to add the <div> to the beginning of the post in the ...
0
votes
0answers
50 views
Wordpress - ABC filter/Pagination
I would like to list out the alphabet on a custom post type archive page, and by clicking on a letter in the alphabet it would link to a url that only displays posts that begin with that particular ...
1
vote
0answers
64 views
Changing image URLs in media library
On a default wordpress install, the media library is located at:
/wp-admin/upload.php. I am trying to update the image URL to point to my CDN, not my local server.
This filter
...
3
votes
4answers
413 views
Run shortcode before filters
My users post snippets code in comments.
I created a shortcode for this :
function post_codigo($atts,$content=""){
return '<code>'.$content.'</code>';
}
...
0
votes
1answer
90 views
Wordpress 3.5+ upload tool filter
i would like to use the brand new wp's upload tool in a personnal theme options page. I found a lot of tutorials like :
wp media uploader in plugins
...and it works very fine. But i'd like to filter ...
1
vote
2answers
28 views
Disable widgets on specific posts
I run a horror related blog. Google is upset with me for displaying adsense in a sidebar widget for one specific post number (4603) that contains an article about an 18+ topic. How can I disable the ...
1
vote
1answer
75 views
add img class to native wordpress galleries
Trying to add an img class = "the image alt field" to the images in a native wordpress gallery so i can use jquery isotope to filter the gallery. I could use the image alt field or the description ...
1
vote
1answer
155 views
Change comments form title on a page by page basis
I'm looking to change the comments form title (my theme defaults this to "Leave a Comment" or "Leave a reply to").
I thought perhaps I could add a hook to comment_form_defaults but my snippet below ...
1
vote
1answer
40 views
Two functions utilizing registration_errors filter
I wrote two plugins that utilize the registration_errors filter:
add_filter( 'registration_errors', 'process_payment', 10, 3 );
add_filter( 'registration_errors', 'add_user_to_SF', 10, 3 );
When ...
0
votes
1answer
52 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);
...
1
vote
1answer
21 views
how to use force_filtered_html_on_import in add_filter?
This is my situation. I have two plugins, one plugin will read a remote XML file and downloads content then it calls a function on another plugin to do the actual importing of posts to the WordPress ...
1
vote
1answer
47 views
Using ob_get_content to get_search_form puts into infinite loop
I am trying to change the look of my searchform. It basically needs to have two text fields. I want this to be in form of a plugin, which anyone can activate. SO obviously I do not have any control ...
0
votes
1answer
26 views
Filter everything from content except output of a shortcode
Is it possible to filter the output of either the content or excerpt so that I only get the the shortcode output and so that if a user enters more than the shortcode the rest of the content for that ...