A type of hook that provides a way for content to be overridden programatically
1
vote
2answers
117 views
How may I filter get_users() similarly to pre_get_posts?
I have filtered posts, pages and custom_post_types based on $current_user custom usermeta field values using pre_get_posts().
Is there a similar method/function to alter get_users() based on ...
2
votes
2answers
221 views
How To Determine If A Filter Is Called In A Sidebar/Widget Context?
So I have a plugin that appends or prepends an enhanced author biography to the content of a page/post/custom post type.
It does this by hooking to either the_content or the_excerpt and ...
1
vote
1answer
60 views
How to debug removal of rewrite rule flushing?
I use Custom Post Types. I try this:
functions.php
add_action( 'admin_init', 'flush_rewrite_rules' );
Now I’d like to remove this again. I try this:
remove_action( 'admin_init', ...
1
vote
3answers
554 views
Overriding wp_get_archives() apply_filters()
I have Googled for a while and I am not sure how is the best way to do this.
In wp-includes/general-template.php I am looking at the function wp_get_archives() which has this line of code in:
$where ...
1
vote
1answer
93 views
Strange behaviour with add_{$meta_type}_metadata | add_post_metadata filter
I'm unsuccesfully trying to use the add_{$meta_type}_metadata. This filter is called inside add_metadata function (wp-includes/meta.php:31 in Wordpress 3.4.2).
In particular I wanna hook ...
0
votes
1answer
72 views
create 2 custom columns in page edit in Admin panel
Hey all i have this code here:
if ( !function_exists('AddThumbColumn') && function_exists('add_theme_support') ) {
// for post and page
add_theme_support('post-thumbnails', array( ...
0
votes
1answer
99 views
How to access variables in the function where apply_filters() is called?
I am trying to filter some data based on whether a variable from within the function that calls apply_filters() is equal to specific value. That variable is not passed to the apply_filters() ...
0
votes
1answer
116 views
How do I filter a custom post type loop by a field?
OK, very simple task, I'm just not good at PHP.
I have a page where I want to list some staff using a styled list. Here is the page all working fine, I just need to divide the results - ...
0
votes
1answer
115 views
Change Mail from and display name with a filter action
I'm attempting to override the from display name and email address using wp_mail function. I am using the hook to modify wp_mail_from with my custom function using ...
2
votes
1answer
41 views
Use safety filters even if after applied intval?
I have some values to save into postmeta and usermeta table. Before save, I already done this: $value = intval($value) . I think this is enough. But I see some plugins still use filters on those ...
0
votes
1answer
71 views
Extending body classes in front- and backend
I want to extend both body classes for the front-end as well as for the admin area. I have seen some snippets floating around, which led me to the following
...
4
votes
2answers
90 views
Valid characters for actions, hooks and filters
I haven't ever seen a tag such as do_action('something_10'). Is it invalid if I use numbers?
If the method is valid, how can I write different numbers in the tag string conditionally? For example, is ...
2
votes
1answer
57 views
Overwrite default WordPress wording
I'm working on a plugin that changes the password requirements to be a bit stricter, however wherever there is a password field to create a password, WordPress' hints are now no longer accurate (e.g. ...
0
votes
1answer
41 views
County Finder form/plugin?
I'm developing a WP site for a client and need to build in a "county finder" for our state (VT). Users would type the name of a town into a field (or select the town from a drop-down menu), press ...
-1
votes
2answers
60 views
Filter to strip unnecessary attributes
I'm looking for a concise PHP filter to add to my functions.php that will search for and strip the following attributes I don't want in my HTML:
rel="attachment"
rel="attachment wp-att-{x}"
...
0
votes
1answer
79 views
manipulate a plugins shortcode
I want to add some javascript directly below content, added by another plugin's shortcode.
We are using the NextGen Gallery plugin and there are many articles containing the [nggallery] shortcode. I ...
0
votes
2answers
99 views
Filter an array with a callback - for single & multidimensional arrays
I've a filter attached, that allows modifying an array:
$data = apply_filters( 'wpse_example_filter', $data );
The problem is, that the data can be a single or multidimensional array:
// single:
...
0
votes
1answer
71 views
Is there any action/filter hook to use when an image gets edited in the editor?
I can't find a specific hook. If I already have added an image to an article via editor and then I edit it, I'd like to intercept the code just before it is sent again to the editor.
I already use ...
0
votes
1answer
86 views
Force resize for all video content
I'm looking for a way to force all video content on my site to scale to 100% width and I'm hoping to avoid using any additional javascript.
Is there a filter or function that I can use to accomplish ...
3
votes
1answer
218 views
How to add filter in “Comments” at the admin panel?
I found so many information and most of the tutorials only talk about adding filter in post/custom post only.
I want to do something similar to this tutorial in 'Comments' area in admin panel.
Add ...
1
vote
1answer
76 views
Wordpress Image update filter
I can't seem to find the filter for an image update.
Right now I have the code below, which works great until someone clicks on an image in the editor and updates it. Then it throws the height and ...
0
votes
1answer
87 views
How to change order of posts in admin
Hi I have set a custom post type with some custom fields, one of the custom fields is a date field which is different from the publish date of the post itself, which is by default used by WordPress to ...
2
votes
3answers
601 views
Add placeholder attribute to comment form fields
I have been trying to add to the default WordPress comment form. I need to add placeholder="" to each field. I can't figure out the filter. I don't get any errors but I don't see the placeholder ...
0
votes
0answers
82 views
Set-screen-option Filter Not Called [closed]
Hello, world!
I'm working on an administration panel for a theme I'm developing. The task I am working on now is adding a "Screen Options" tab for a list table. I have the page load hook in place, ...
0
votes
2answers
937 views
Add_filter rel=“prettyphoto” to WP3.4.1
I know there have been a couple of questions in relation to this and had a look at them, but mine differs slightly on the problem experienced and the code. I am basically building my first theme and ...
0
votes
1answer
164 views
What filter or action hook to use in order to load some code before the template begins printing in BuddyPress?
I would like to load some code before the template begins printing in BuddyPress. What filter or action hook should I use?
I tried a number of them (such as bp_head, bp_include, bp_init), but none of ...
0
votes
1answer
100 views
Modify message displayed on post save
After a post is updated there is a message displayed, how can I change the displayed text? I would like to remove the "view post" link and change the 'Post published' text. I'd like to do this for a ...
0
votes
2answers
57 views
Which hook should be used in this case?
I'm using the enter_title_here filter to modify the 'Enter title here' text in a custom post type, question is what hook should I use to trigger this function?
I have used admin_enqueue_script as a ...
-1
votes
1answer
76 views
Changing document title only on a custom page template
Hi can anyone help with the below, please?
I want to be able to change the contents of my HTML <title> tag only, so need to write an if / else statement.
I'm getting myself a bit muddled as my ...
0
votes
1answer
177 views
Tiny MCE custom styles, and preview in the backend
I've added the styles dropdown list to my TinyMCE editor in Wordpress. If I select the style, and preview it on the front end, it looks exactly like I expect it to. However, I'd like to preview it ...
0
votes
1answer
166 views
Filters on the_content with plugins, pages and shortcode
I am using a plugin to add tweet, likes... This plugin add filters to the_content() to display this social buttons on a blog page (list of posts).
I coded a shortcode which does a custom SQL query ...
0
votes
1answer
69 views
confusion with add_filter
I am trying to customize the default WordPress search field. So I thought I could add a filter to remove the function and then add in a new function with the fields the way I want them. So I tried ...
1
vote
1answer
107 views
Get list of registered or enqued styles? looking for filters or actions
Where can I get the list of styles about to be printed? What i want is to either filter the list, doing what i want with each, then return empty list. Or do an action that recieves the list, then i ...
0
votes
1answer
161 views
Replace single_template filter with what for default posts?
I was going through a tutorial on Justin Tadlock's blog but it uses the single_template filter, which was removed in 3.4. The codex says to use {$type}_template but if I use "post_template" with the ...
0
votes
2answers
80 views
About Hooks and Filters
Well, am having a very hard time understanding the difference between Actions and Filters. I do use actions in my code, but am a rookie and I don't know even a slightest bit of Filters.
I have been ...
2
votes
3answers
565 views
How to wrap an element around an iframe or embed in content automatically?
Id like to have wordpress automatically wrap a div around any iframe or embed when they are used in the_content...how might this be achieved?
2
votes
0answers
81 views
How to display term description in empty terms archive?
I list all terms from a taxonomy, even the empty ones, but I found out that at least in 2010/2011 themes I got a 404-like message, the default seems to only display the term description when at least ...
1
vote
4answers
104 views
Echoing Categories only if they're a child of a given category
I've got posts that I want to echo after the post content the categories only if they're a child of a given parent category.
Example:
Parent category: Goal
Child categories of "Goal": brand ...
0
votes
1answer
41 views
WXR XML import is stripping php tags that I need to keep
When I import my WXR XML file it appears that wp_insert_post (or another function) is applying filters to strip php tags that I need to keep in my content.
I have searched the various wp-include php ...
1
vote
3answers
1k views
How do I add the featured image to the_content after the first paragraph?
My problem:
I'm trying to create a filter that will add the featured image of a post to the_content, so that I can have the first paragraph of the_content displayed before this image.
What I basicly ...
3
votes
1answer
174 views
Looking for a hook to add attachment information to the media library tab
I would like to be able to determine if an image has been attached to a post by looking at the collapsed viewmedia library tab. Is there's a hook I can use to add that data to this view of the Media ...
2
votes
1answer
109 views
How to update feed only 2-3 times a week (for Feedburner email)?
So many of you know that Feedburner is a great (free) tool for sending out newsletters. The problem is that if you add content everyday, everyday emails will be sent out.
I'd like to control on ...
0
votes
1answer
238 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,
...
0
votes
2answers
435 views
How to replace the_post_thumbnail template tag and show the first inside the post image instead
I want WordPress to return the first post image or a default image if no featured image has been set. My theme uses the_post_thumbnail many times, so I don't want to go through and change all ...
0
votes
2answers
580 views
Make a Shortcode load after Post/Page Content?
I created a shortcode for time.ly's "all in one event calendar app" that makes a paginated list of upcoming events with out all the java script and user options.
I posted about it here. (Its still a ...
1
vote
1answer
98 views
Stop loading “collaborators” users on add new post or page?
So our website has about 20k "collaborators" type of users and we'd like to stop loading all of them on the select box on the "add new post" or "add new page" PAGE. Maybe load only authors and above ...
2
votes
1answer
222 views
Adding posts of custom type into the main feed
I'm having some trouble with a subject that seems to be pretty basic, so I'm starting to feel (a little, only a little) dumb :-)
Here's the thing: I want my main feed to include the posts and other ...
1
vote
0answers
94 views
proper use of the_content filtering
this is a bit difficult without posting scads of code, but my question is: What are the benefits of filtering through apply_filters('the_content', 'anything');, and given my example loop, am I ...
1
vote
1answer
287 views
Replacing with(out) regex link to attachment by links to files
I tried to do it myself but I have really hard time with Regex (regex is hell. I just don"t understand).
Anyway, I think this would be usefull to some people. The context is that we use a plugin to ...
4
votes
0answers
116 views
Custom query incorrectly returning everything [closed]
I'm missing something somewhere, but I cannot connect the dots. Everything outputs properly except that the query returns everything from the DB, not just posts. Can anyone spot a reason for this ...