Tagged Questions

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

learn more… | top users | synonyms (5)

0
votes
1answer
29 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
36 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
14 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
57 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
29 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
50 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
11 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
88 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
12 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
53 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
28 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
76 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
60 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
61 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
86 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
38 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
193 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
206 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
44 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
18 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
252 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
134 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
33 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
103 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
44 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
25 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
40 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 ...
1
vote
0answers
97 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
21 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
37 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
32 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 ...
0
votes
1answer
45 views

Custom view counts not updating correctly

I'm trying to add some custom views/filters to the list of posts for a custom post type in the admin. However, the query that counts the number of posts is updating the number of posts for all filters ...
1
vote
1answer
72 views

Changing a WordPress core function without hacking core

I am looking to change one line within a core function. The function is wp_allow_comment() located within /wp-includes/comment.php function wp_allow_comment($commentdata) { global $wpdb; ...
0
votes
1answer
58 views

Hide H1 Title using the_title filter

I am trying to hide the pages H1 header IF a custom field specifies this. On a page back end I have added a custom field: Name = hide_title Value = true I then want to hide only the H1 using a ...
0
votes
1answer
581 views

Can't get content of all (19) posts - Incomplete Chunked Encoding

I've got some documentation stored in a WordPress install for something I'm developing, and I want to have a pure html, single page version of it in addition to the regular templated version which is ...
0
votes
0answers
26 views

wp_nav_menu: current_post_ancestor-category parent

I have a nav like this: page 1 -- page 1.1 -- category 1.2 page 2 page 3 When I am on a single post in the category 1.2, the category-menu-item gets the correct class current-post-ancestor and ...
0
votes
1answer
32 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
36 views

How to make the 'delete' button inactive on some categories?

As currently there's no way to declare any new custom post format in WordPress (3.9.1), is there a way I can make the 'delete' button on some categories inactive, so that the Editor can't remove them, ...
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
0answers
59 views

Problem with adding values to 'post_updated_messages' filter

I'm having an issue with adding a filter to 'post_updated_messages' that I don't quite understand. I've written a function like so; function acc_course_updated_messages( $messages ) { $post ...
0
votes
2answers
530 views

add_filter the_content in functions.php not working

I want to add_filter for the_content in functions.php of my theme. I have added code which just display echo but it seams that my filter is not applied. function add_mod_hatom_data($content) { // ...
0
votes
2answers
84 views

Create new custom post and post category of same name

I have a custom post type "Product" and want to create a post category "A Product Name" automatically on creation of a new Product so that the post category (not custom post category) would have the ...
3
votes
1answer
96 views

Using hooks to place content in theme dynamically

Alright, so I think I may be getting a little too complicated on this, but I basically want to know if this is possible. I am using a content slide function where I display some thumbnails within the ...
0
votes
1answer
109 views

Return a custom value in a function added to an action hook

I looked into the difference between action and filter hooks, and as far as I understand, it is not possible to have a function, which is added to an action hook, return a (custom) value. My ...
0
votes
2answers
71 views

Admin filter/error if post title is too long

Is there a filter that will throw an error if the posts creator enters a post title that is too long? I am looking to throw an error like: "The title you've entered is more than 30 characters. Please ...
0
votes
0answers
4 views

How to remove a filter that has been added as a function [duplicate]

How can I remove a filter that has been added the following way: // Add the filter before executing the query add_filter('posts_where', function( $where ) use ( $lat, $lng) { return ...
1
vote
2answers
51 views

Dump contents of a variable inside a filter/hook callback that runs during save post

I just need to debug an array which comes into addfilter function like this: add_filter('pll_copy_post_metas', 'copy_post_metas'); function copy_post_metas($metas) { var_dump($metas); return ...
0
votes
1answer
66 views

Pre_Get_Posts order DESC not registering

I've created a filter function to filter a post type items by it's meta value _item_price. The problem is that it only works in Ascending Order and I'm not sure why. My pre_get_posts function looks ...
0
votes
0answers
38 views

Get media-uploader fields array

I want to modify the fields in the media-uploader. To do that I need to know what creates the fields. In the Codex, you can see a way to add new fields to the media uploader, using the ...
0
votes
0answers
79 views

External Script Using WP - Hooks / Actions Not Working?

I've researched this problem in depth, but still stumped. Simply stated, I have an external uploader script which loads WP. Yet I cannot seem to grab any of the actions/filters I've put into it. Why ...