Tagged Questions
1
vote
0answers
49 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
...
0
votes
0answers
24 views
attachment_fields_to_edit stopped working in plugin following 3.5 update
Following an upgrade to WP3.5 Elvin, a plugin that duplicates images (by duplicating metadata, not by actually copying the image) stopped working.
The plugin, BDN Duplicate Images, is just one file ...
1
vote
2answers
35 views
How to change the name of the “edit my profile” link in the WordPress admin backend
I am really confused at this point. I can not figure it out how to rename Edit My Profile link in the admin backend.
How can that be done?
0
votes
1answer
48 views
How to add different CSS for galleries
I use jetpack carousel for all of my galleries , even for my featured image, my question is, how do I style my [gallery] outcome to use different CSS for the featured image so I can manipulate it a ...
1
vote
1answer
30 views
Creating a plugin to sanitize comment and the url field before display only
I want to create a plugin to sanitize comment and mainly the url field before display only (not before adding to database), to filter the url fields and only allow displaying this field only if it ...
1
vote
0answers
18 views
What is the purpose of $merged_filters?
Savvy WordPress user here, or at least trying to be. I have the hang of hooks and filters with the code in WP's plugin.php
The only thing I cannot seem to understand is the $merged_filters global. ...
0
votes
1answer
62 views
Does the 'nav_menu_css_class' filter accept 2 or 3 arguments?
I've been using the nav_menu_css_class filter in one of my plugins, implemented as:
add_filter( 'nav_menu_css_class', 'wbwcrf_nav_menu_css_class', 10, 3 );
function wbwcrf_nav_menu_css_class( ...
1
vote
0answers
76 views
Filtering get_permalink in Jetpack / ShareDaddy
I recently changed my permalink structure from /YYYY/MM/%post_name%/ to /%post_name%/, and lost my tweet counts and likes (provided by Jetpack) in the process.
To fix this, I want Jetpack to use the ...
0
votes
0answers
126 views
Good examples/resources for using a drop down for filtering jquery isotope? [closed]
I'm working on a plugin that uses jquery isotope and I've also built a widget that will handle the filtering using terms and taxonomies. What I would like is to have a drop down of terms of a taxonomy ...
0
votes
1answer
79 views
Custom priority with the_content filter based on user input
Currently, in my plugin Contextual Related Posts, I have an option to automatically add the related posts to the content using
add_filter('the_content,'ald_crp')
I know I can change the priority ...
0
votes
1answer
147 views
Where is the best place to use add_filter
Should I use the function add_filter In my plugin's init action hook or just the in the main plugin script?
Since sometimes I found people is using filter all over the place and if I put in the init ...
1
vote
3answers
99 views
How can I filter blog name?
I want to filter the blog's name for Google's user agents.
I have tried the_title, the_content, comment_text, single_post_title, wp_title, category_description, bloginfo hooks, but none of them ...
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: ...
-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
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 ...
1
vote
2answers
60 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:
...
2
votes
2answers
182 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 ...
0
votes
1answer
39 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 ...
0
votes
1answer
157 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
86 views
Simply Exclude - Category feed exclusion is excluding from category feed instead of just the main feed
I am using Simply Exclude to make sure that certain categories do not show up on the home page and in the sites main feed, http://example.com/feed. However, excluding the category from the main feed ...
0
votes
1answer
227 views
How to only hook on Single.php after content?
I am currently hooking on the_content() but that goes through the Wordpress loop too. How can I only hook on the Single.php page?
Also, is there a way to only look on the first X posts in the ...
2
votes
2answers
140 views
What characters are allowed as a shortcode tag and how should they be sanitized?
I am working on a plugin where the user can define shortcode tags himself. What would you suggest to allow in there? My thought is only allow ascii characters.
So how do I sanitize? strip_tags and ...
0
votes
2answers
614 views
How to append new form elements in “Add New” form of Users in Wordpress admin panel?
I'm developing a WordPress plugin and I want to append some extra form fields in add new form of Users section inside admin panel without editing core files. Can somebody help me in achieving this.
0
votes
1answer
34 views
Add a filter to a different custom plugin
Someone has built a custom plugin that adds a textarea on the admin/edit page, and a div on the pub page. I no longer have access to the person who built the custom plugin.
I have created a filter ...
0
votes
1answer
75 views
Filtered content appears in the excerpt
I am modifying the content using the "the_content" filter. But this filtering is seen in the excerpts also.
Consider the following code,
function modify_content($content = ''){
return 'HELLO ...
7
votes
1answer
1k views
Passing a parameter to filter and action functions
Is a way to pass my own parameters to the function in add_filter or add_action.
For example take a look in the following code:
function my_content($content, $my_param)
{
do something...
using ...
2
votes
1answer
156 views
locate_template with multiple categories?
in this example (from Wrox book), if a single-category-$slug.php file exists, it will be shown, otherwise it's the single.php file. But if we have more than one category for each post (let's consider ...
0
votes
1answer
44 views
Looking for a filter to modify the months
Hi making a simple plugin that replaces the wrong russian month with the right ones.
But I can't find any filters that works.
I have tried these filters without success:
...
0
votes
2answers
1k views
How can I edit post data before it is saved?
I have a plugin and I would like to be able to run the post content through some filters before it is saved to the database. From looking at the plugin api, I see that two hooks that look like they ...
1
vote
1answer
101 views
How to find the origin of a file upload from within wp_handle_upload?
I have a plugin that hooks into "wp_handle_upload" filter. Within that scope I'd like to be able to identify where the upload came from, meaning I want to treat it differently if it was uploaded from ...
0
votes
0answers
2k views
How to use `the_content` filter properly? [closed]
I have a plugin that filters a particular page, and another plugin(a widget actually) that uses WP_Query to display a number of posts list. The problem is when I am on that particular page that is ...
0
votes
2answers
418 views
Editing wp-config.php
I need to add the line define('WP_POST_REVISIONS', false);
to my config.php , so that post revisions are disabled.
I don't have access to wp-config.php, I have permission to edit my theme and ...
0
votes
1answer
315 views
Using add_action before add_filter on a plugin?
I'm writing a plugin and having a problem. I have add_action('publish_post', 'sender'); and I want this function to run first before the add_filter function, although it won't. Is there a way to do ...
0
votes
1answer
52 views
Is there a way to figure out which action/filter invoked a function?
I'd like a lightweight way to figure out what is invoking a certain action in an effort to provide logic for certain scenarios where I can't help to avoid a function invocation (for example, a new ...
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 ...
0
votes
1answer
194 views
What's the best way to echo out a filter variable?
I have a plugin filter that isn't working for me:
add_filter( 'gform_notification_email_3', 'route_notification', 10, 2 );
function route_notification($email_to, $entry) {
global $post;
...
2
votes
1answer
270 views
There's some way to add a wrapper around posted images?
I need to add a wrapper (I'll use <figure> in my example) around images posted through the editor, with a variable depending on the size image is being posted (thumbnail, medium, large, full), ...
0
votes
3answers
9k views
Is there any multiple filter/criteria plugin for wordpress?
I'm interested in a wordpress plug-in that is able to make from tags or categories multiple search criteria like left hand side of the following site system http://www.olx.com/dvd-cat-238
When one of ...
0
votes
2answers
345 views
Check if variable is set in filter
Thanks to your suggestions, I enabled wp_debug and discovered flaws with my plugin. I have a filter for sorting posts by votes. I use it when the sort URL parameter is on.
add_filter( 'posts_where', ...
1
vote
1answer
611 views
add_query_arg not working
I added a filter to append a parameter onto the URL when navigating in categories. This is used to sort posts by their votes when browsing a category only if a sort parameter is set.
For instance ...
0
votes
1answer
241 views
Edit post image attributes on fly?
Greetings, We can edit image attributes with this get_image_tag filter when we are adding images or with regex and filter the_content,but is there any similar filter or action that can we use to edit ...
1
vote
2answers
83 views
Modifying the comments section through a plugin regardless of theme
I need to be able to add some data (text/images) to each comment in the comments section through a plugin. What I'm trying to do is actually very similar to the way the stack exchange sites have their ...
