0
votes
0answers
13 views

If Specified Page then Redirect Elsewhere in Plugin

There's a few parent pages that only exist for URL purposes, but the actual page themselves need to be redirected to the home page since they're blank. I'm trying to make a simple plugin that will ...
1
vote
1answer
31 views

Is it acceptable to treat a filter like an action?

The wp_insert_attachment_data filter is available inside wp_insert_attachment(). It allows attachment post data to be filtered before it is updated in or added to the database. $data = apply_filters( ...
0
votes
0answers
20 views

Creating a filter to modify links ending in .pdf

I'm trying to create a filter that checks for links that are to PDFs, and append the href attribute with something like /form?file=[path to pdf]. For example, starting with: <a ...
0
votes
1answer
89 views

Exclude Custom Post Type from shared Custom Taxonomy

I have a few custom post types and two of them are sharing a custom taxonomy. Is there a way to list the terms of that taxonomy for only one of the custom post types? At the moment I can get a list ...
1
vote
0answers
510 views

How to set a custom path, for ajax image upload folder in admin?

I am coding my first Wordpress plugin that handles some data for a custom (shop-like) post type. It also has an image uploader within a metabox, where you simply drag in your images and it ...
1
vote
1answer
189 views

Run a filter when a walker runs

Is there any way to run a particular add_filter function whenever a specific Walker_Nav_Menu class runs? The function always needs to run when the walker goes, and I'd like them to share variables, in ...
0
votes
0answers
201 views

using ACF datepicker to filter posts on a page

i’m using a wp-query to display posts from a category on a custom post type page. it works fine, and I’ve been also abble to sort my posts depending of datepicker field called “date_debut”. my posts ...
0
votes
1answer
30 views

append PHP function to the_content

I'm using the Jetpack plugin for related items and social sharing. Both of these options filter the_content and append themselves to the end of it. The problem is that I'm using custom navigation in ...
0
votes
1answer
87 views

Select All not working in a WordPress search filter

I am trying to create a Search Filter within WordPress to filter through all the custom taxonomies within a Custom Post Type. I have created a function that generates the dropdown so I can output ...
0
votes
2answers
377 views

Permanently remove first image from posts

I have around 2,500+ posts on my site where I've inserted images using the traditional method into the post content itself. In upgrading to a different theme, the single post page now displays the ...
0
votes
1answer
64 views

Add filter multiple times using only one master function

Is it possible to use add_filter with lets say an array of different values? to achieve something like the following: foreach($templates as $name) { add_filter( 'single_template', function ( ...
0
votes
3answers
367 views

How to list the Hooks and order of execution in current loading page?

I need to know the list of hooks that are called in the current page . How to identify the priority assigned to the action and filters in the action . If i want to remove the default action on ...
1
vote
1answer
104 views

How to overwrite youtube embed?

I really like how you can just paste a URL right into the post... such as: http://youtube.com/watch?v=xyz or http://vimeo.com/123456 What I want to do is change the default code for this to support ...
0
votes
0answers
31 views

Custom field in title

I'm trying to change the posts with no titles to 'custom field' + 'mystring'. So far I got this code. add_filter( 'the_title', 'ta_modified_post_title'); function ...
-1
votes
1answer
42 views

AJAX: Wordpress filters inside $html do not work as intended

I am sending HTML content through some AJAX magic and while everything is working as I wish, the output gives something along those lines in the page: "http://permalink.comtitle" It's as if all the ...
0
votes
2answers
876 views

Reposition Woocommerce Message

I'm trying to reposition the messages in my Woocommerce theme. For example the successfully added to cart message. They appear to automatically be placed at the very top of where the woocommerce ...
1
vote
1answer
486 views

Rename image uploads replacing “width” and “height” in filename with “medium”, “large”, “small”

Good morning, I am trying to change name format that Wordpress uses to rename uploaded files. As I upload an image whose filename is "desert-landscape.jpg", Wordpress will set up scaled versions and ...
2
votes
1answer
49 views

How do I know what variables are passed in a filter/action and what their meaning is?

Something I have seen several times now and I don't understand is the following: In a theme's functions.php a function is defined and then attached to a hook, like so (simplified example): function ...
0
votes
1answer
19 views

Wordpress - show all posts + ones with specific tag

I have 3 types of posts as below Normal posts without any tag With "featured" tag With "sold" tag On a page, I just want to show normal posts + ones with featured tag and don't want to show posts ...
1
vote
1answer
184 views

Change the footer text on the login page

I am customising the login page and would like to alter the footer text that takes the user back to the website. Ideally and as an example, changing it from the first image, to the second just below: ...
0
votes
1answer
49 views

Search box background on a different page template

I'm trying to make the search box background the same as the homepage, but for some reason there is a orange background - it doesn't use a different header.php its called within a filter the code ...
0
votes
2answers
30 views

Deleting Certain terms from appearing on the front end as links

I've put some thought into this but Can't really figure out what direction I take in getting rid of certain terms in my testimonial_category called 'home', 'homeone', hometwo. I only want to stop ...
0
votes
1answer
500 views

dynamically filter by category via sub-menu

I'm trying to figure out if it's possible to dynamically filter my custom post types by category via a sub-menu I have set up. So I've set up a custom post type: news and enables categories that I ...
2
votes
1answer
62 views

Why do filters/actions require an argument count?

I was just looking at plugin.php trying to answer the above question and I couldn't work it out. The actual code that calls filters is this: do { foreach( (array) current($wp_filter[$tag]) as ...
0
votes
0answers
481 views

Filter posts by multiple checkbox categories

I would like to set up a widget to filter my post by categories. Let's say, I do have two different categories, "Countries" and "length of stay" with sub categories. Here is an example of what I have: ...
0
votes
1answer
800 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 ...
1
vote
1answer
114 views

Remove class that has been added by parent theme

My parent theme generates the following class in body: style-cupcake. I don't want that. The best way to get rid of this is by adding my own functions in a functions.php file in my child theme, right? ...
3
votes
1answer
454 views

Hide custom image sizes from media library

I want to hide a few custom image sizes from the media uploader: The following code (posted here) works only for the default image sizes: function remove_image_sizes($sizes) { ...
0
votes
1answer
206 views

Display a list of users with avatar filterable with alphabets

I'm trying to create a page which should display a list of users with the role "Author" only and exclude all other default and custom roles. I also want them to be filterable by alphabets, so if I ...
0
votes
2answers
184 views

Content filter won't work

I'm trying to filter my content and on matches on flow I would like to change my html structure, but my rule doesn't really apply. I have the following filter which searches the first image of posts ...
2
votes
1answer
2k views

Rename image uploads with width in filename

I am attempting to change the name format that Wordpress uses to rename uploaded files. For example, when I upload an image with filename "cat-picture.jpg" Wordpress will create scaled versions and ...
11
votes
2answers
815 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 ...
6
votes
1answer
1k 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 ...
7
votes
2answers
1k 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 ...
2
votes
1answer
475 views

Rewriting search and pagination base

After trying for weeks now how to find a working solution I got rid of most of my functions and trials and just left the pagination function underneath in my functions.phh file: /** * Pagination ...
0
votes
1answer
210 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
65 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 ...
2
votes
4answers
368 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 ...
0
votes
1answer
122 views

Change page title from page using php via php executed from page/post itself

I am running a plugin from a WP page to execute PHP and it works great. I'd like to edit the page title and description based on POST data. I am already using POST data in the PHP code to alter the ...
0
votes
1answer
67 views

Wordpress doesn't load HTML

All, I'm trying to have a side navigation menu that once you click on a link it basically pulls the content of that wordpress page and displays it. I've got the following code to do this: $qry = ...
0
votes
2answers
210 views

How to make modifications only to certain elements of an HTML string on the server-side?

Is there a similar way to select / perform DOM manipulation on the server-side (PHP) like the way jQuery works? For example, if I wanted to modify content of each <pre ...
1
vote
1answer
324 views

How do I alter the comment form 'allowed tags' text in a plugin?

I'm using the PHP Markdown plugin, and I'd like to modify it so that it adds some text to the bottom of the comment form indicating that Markdown is supported in comments. I've been modifying my ...
1
vote
1answer
191 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 ...
0
votes
2answers
144 views

Alter required message using comment form api

I prefer not to use asterisk markers on required fields in the comment form. So I'd like to remove or alter the 'required fields are marked (*)' message. Being a good wordpress user, I'd like to do ...
1
vote
1answer
370 views

Taxonomy filter all children

I have a custom taxonomy filter that will filter all the pages in the selected taxonomy. I would like the code to select the pages in that taxonomy, and the children of thous pages. Heres the code. ...
0
votes
2answers
301 views

How to internationalize header image?

I have in the following code in the template: <img src="<?php header_image(); ?>" /> However, I want to change this image according to the language selected (through GET parameter ...
2
votes
1answer
572 views

Apply class to every paragraph that holds image?

Hey guys, When adding an image to a page or post wordpress is automatically adding a paragraph tag as parent holding the image. since there is no parent selector in CSS I'd love to find a solution ...
1
vote
1answer
3k views

adding a filter to a shortcode?

<?php echo do_shortcode('[mingleforum]'); ?> inserts the mingle forum into my content! is it possible to use add_filter() on that?
1
vote
3answers
5k views

add_filter to post-gallery and remove all <br>'s?

hey guys, i really need your help. Whenever I use a gallery in wordpress and set it's columns to just 1 Wordpress automatically adds <br style="clear: both"/> after every <dl ...
0
votes
2answers
374 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', ...