A type of hook that provides a way for content to be overridden programatically

learn more… | top users | synonyms (5)

0
votes
0answers
11 views

Autogenerated Title for Custom post type loses title when trashed/deleted

I am generating title for a custom post type using the following code. It takes the $fname, $mname, and $lname values and generates a title based on the post. This works fine for custom post creation ...
0
votes
1answer
11 views

add class to internal links in content

i want to add a class to all links inside of the_content, that point to other interal content, f.ex. other posts and pages. i want to do this automatically. dunno if the best practise would be, to ...
0
votes
1answer
8 views

using posts_where for meta data on pre_get_posts

Let's say you have some code which filters posts by using pre_get_posts e.g. add_action( 'pre_get_posts', 'be_exclude_category_from_blog' ); function be_exclude_category_from_blog( $query ) { ...
1
vote
0answers
17 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
votes
0answers
16 views

Where are the filters stored in woocommerce plugin folder [on hold]

I am debugging a WordPress theme that is woocommerce enabled and found in some pages apply_filters command ,but I don't know where to find these filters declaration file in the plugin directory, ...
1
vote
2answers
17 views

apply_filters/do_action tag characters limit

Does apply_filters/do_action $tag name have a characters limit? Can be any problems if the tag name is way too long? I ask this because I know that WP transients have a limit of 45 characters. FYI, ...
-1
votes
0answers
21 views

Why Won't My Customisations To The Woocommerce Checkout Work? [on hold]

I'm trying to customise the labels of the Woocommerce checkout fields using actions and filters by following the guide here: ...
0
votes
0answers
25 views

AJAX filter posts on click based on category

This is my first foray into AJAX, I've been splicing bits of code from various tutorials which probably hasn't helped. I have a list of categories on my homepage (index.php) and a list of the most ...
0
votes
2answers
12 views

Does auto_update_plugin Filter Work When Put In Theme's functions.php File

I wanted to know if the (auto_update_plugin) and the (auto_update_theme) filters work when put in theme's functions.php file instead of config.php file in WordPress core.
0
votes
0answers
29 views

remove_filter right way

What is the right way to remove filter in condition? method 1 public function update_loop($query) { global $wp; if(!$query->is_main_query() || $query->is_admin) return; ...
1
vote
1answer
26 views

Hook Into the_content Filter For JSON API Only

I'm trying to figure out a way to remove the shortcodes from my JSON output which I'm using the Wordpress JSON API for. I need to remove the shortcodes from the content before do_shortcode is applied ...
0
votes
0answers
12 views

Post where filter not working with Ajax

I am trying to add filter "add_filter('posts_where', 'location_multicity_where_changes_ajaxin'); " with ajax but it is not working. After i call this in functions.php via add action it ...
0
votes
1answer
31 views

Keep post format class with isotope filter

When I add isotope filtering for displaying posts, I lose the format class. WITHOUT isotope filtering: <article id="post-22" class="post-22 post type-post status-publish format-image hentry ...
0
votes
0answers
16 views

Add menu/submenu items programmatically

Newbie question here. I'm hoping to modify a menu programmatically and am having trouble figuring out the right way to do it. My site uses a membership plugin. Users pay to become members, and ...
2
votes
1answer
35 views

What's the best way to split admin-only functionality in the theme's functions.php file?

I am customising a Wordpress admin area and so far so good with a number of add_filter and add_action calls in my theme's functions.php file. But I'm a bit worried because all this code will be ...
0
votes
1answer
33 views

Filter and display a specific custom field value [closed]

I am developing a travel website for an agency. I'm trying to to make the user able to select an option like "Select your departure" and filter the loop with all the departures available for the ...
0
votes
1answer
20 views

Register users by e-mail

I want to use an email address instead of username to register and login my members. I've got the login part working using some of the code in this answer. Works fine but as expected wordpress still ...
0
votes
1answer
26 views

WordPress filter to hook into menu <li> items and add a custom attribute

I have a WordPress template (I'm using Foundation as a base and https://github.com/olefredrik/foundationpress/ as a starter theme) I'm trying to build and I can't seem to figure out how to hook into ...
0
votes
0answers
14 views

Custom the_content filter?

I have written a plugin which uses a WYSIWYG editor to output a custom success or error message that the user can specify. HTML is allowed within the WYSIWYG editor, and I have used the_content ...
0
votes
1answer
13 views

Hook into 'when user logs in' [persistent login]

I'm trying to create a persistent login mechanism in Wordpress (I can't find a plugin, but if there is one, let me know!). But I'm struggling to find a hook (add_action or add_filter) that runs when ...
0
votes
2answers
25 views

Retrive images from the_content()

I would like to get the images from the_content(), I know I could use a regex to get the images but I wanted to know if there is any other more 'wordpress way' for doing this? I have this within a ...
0
votes
0answers
8 views

When adding media, can I filter the HTML generated from “Insert From URL” before it hits the editor?

function test_function( $html ) { return $html . 'TEST!'; } add_filter( 'post_thumbnail_html', 'test_function', 21 ); add_filter( 'image_send_to_editor', 'test_function', 21 ); add_filter( ...
0
votes
1answer
36 views

passing '&' in return function of add_filter

I have below line in my return function of add_filter in wordpress. add_filter('the_content', 'my_drama_func'); function my_drama_func () { return "function getthrough() { jQuery.ajax({ ...
0
votes
1answer
17 views

Surround uploaded image link with div

When you upload image you have smth like this <a href="http://vitya/wp-content/uploads/2014/06/8.jpg"> <img class="alignnone size-Small x Big wp-image-65" ...
0
votes
3answers
37 views

Once redirected by Rewrite rules, how can WordPress know the page?

I have been searching for some configurations of .htaccess, filters and hooks to make able to manage the inner site uri's. The goal was force login, register and admin pages through SSL, and all the ...
0
votes
0answers
8 views

How to change the structure of an image attachment in a post?

I'm trying to solve a problem with the attached images in a post. Somehow the structure is not working right on a theme i'm using. Instead of showing a div with the class "wp_attachment" is just a h6 ...
1
vote
1answer
37 views

Apply the_content filter, but prevent other hooked actions

I have a plugin that displays some content onto the front end of the site after applying the_content filter to the block of text. I do this for formatting and maintaining links and images etc. When I ...
0
votes
0answers
5 views

How to set “Unattached” option as default in Media Library?

When inserting an image into a post, I want the "Unattached" filter to be the default upon opening the media library. Screenshot Any way to do this?
0
votes
1answer
29 views

Add Class to a div using a filter?

is it possible to add a dynamic class to a div using a filter in the functions.php? I know it's possible for the body-tag - also for a custom defined div with an id? if ( !is_search() ) { ...
0
votes
0answers
14 views

Role Column Sorting

I'm trying to add sorting on Role column on user listing by desc and asc but I can get it work, it always show "No matching users were found." below are my code add_filter( ...
1
vote
3answers
47 views

Show excerpt for only first post in query

I'd like to only show the excerpt for the first post in my main query. I was wondering the best way to approach this. What I have tried so far is: Making a custom homepage and using two queries, ...
0
votes
1answer
27 views

Email Obfuscation: Is antispambot() Acceptable? [closed]

I've been looking into Email Obfuscation and trying to get away from obfuscation plugins when I ran across this code snippet[1]: function remove_plaintext_email($emailAddress) { $emailRegEx = ...
0
votes
1answer
16 views

Removing filter dropdown in posts table (in this case Yoast SEO)

I don’t need Yoast SEO meta box for one post type so I removed it with remove_meta_box(). Removed unneeded columns in post table by unsetting columns with manage_edit-custom_post_columns, but drop ...
0
votes
3answers
48 views

Sort Posts By Category?

Googled this for hours, cannot find a solution. On my theme you have a Browse page which pulls all the videos from the Custom Post Type I am working with. If a user makes 30 categories then id like ...
0
votes
1answer
19 views

How to add a filter to get_the_author_meta?

I need to filter calls to get_the_author_meta() but I haven't been able to do it. I'm using a plugin which uses this function: get_the_author_meta('display_name', $p->uid)` I need to be able to ...
1
vote
1answer
173 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
54 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
11 views

term_link filter gives less atributes

I have made a filter for term_link but when I work with it, I get message about not getting the second and third attr. Its a pitty, i need them add_filter('term_link','authorsongsurl',10); function ...
0
votes
0answers
13 views

How do I adjust/remove img widths when embedding posts in a narrower external site?

I have a blog on a PHP site i.e. http://mywebsite.com/blog/ and want to embed complete posts in a page on http://mywebsite.com/ include('blog/wp-load.php'); $post=get_post($postid); ...
0
votes
0answers
72 views

Use Ajax To get posts from custom post type?

I am using isotope to show post from post type. But the problem is i have paging and i cannot filter post by using isotope, its only filter in one page, and cannot get post from other page, So, i ...
0
votes
1answer
56 views

Add Bootstrap Classes to Recent Posts Widget

I am building a site that is based on an existing theme, lawyers. I am tasked to make the recent posts widget look like the practice areas section, I would need to add some structural divs (bootstrap ...
0
votes
1answer
15 views

WP_NAV_MENU filter targets all menus

Im trying to replace my template's primary menu through a plugin so that I don't have to make changes to the header.php. I found this code in another question answered here in 2011 (Replacing ...
0
votes
0answers
36 views

Filter Users Using Custom Admin Role

I have created a custom user role in my WordPress installation called Inactive, which identify users that don't write posts or pages anymore (This role was created for archival purposes, as a kind of ...
0
votes
0answers
23 views

How to Add A Rel Filter to All Links?

How can I add a filter in the functions.php to all links tags? Basically I am needing to add a rel="tooltip" to all my anchor tags within WordPress. I appreciate the help. Thnx
0
votes
1answer
21 views

Filtering more than one term in a taxonomy in WP

i have a custom post type called 'events', it has a taxonomy named 'category' structured this way: hotels (parent) -1 star (child) -2 stars (child) -3 stars (child) location (parent) ...
0
votes
0answers
24 views

Wordpress Unit Testing cleaning up hooks and filters

Using Wordpress' unit testing suite has been going quite well, and it's nice the WP_UnitTestCase takes care of cleaning up table data after each unit test. But one thing that doesn't seem to be ...
0
votes
0answers
44 views

SSL certificate for the host could not be verified

I'm getting this error in a log file created by WooCommerce "The SSL certificate for the host could not be verified." The error is being generated by WordPress' file /wp-includes/class-http.php ...
0
votes
1answer
16 views

Filter on widget-title does not work with custom links

I added a filter to my widget titles and it looks like the filter doesn't apply on links, which are created with the links-sidebar. It does work perfectly on the blogroll or search widget Here's a ...
0
votes
1answer
30 views

Print all inline styles to head

Currently working on a project here http://palanquin.shrimp-works.com. When I try to validate what I have done so far, using http://validator.w3.org/, I get lots of this error Element style not ...
1
vote
1answer
20 views

how to customize rss feed tags using hooks?

My RSS feed is displaying an XML tag which I either want removed, or emptied. The tag in the XML looks like so: <wfw:commentRss>remove/this/uri</wfw:commentRss> I have never used hooks ...